From 12a487b61f809aa4794578e14efe32d717f22bdb Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 26 Nov 2015 21:16:12 -0600 Subject: Split do_ps() into get_ps() and show_ps() as a start on implementing --sort. Change readfileat() to pass back length of read. --- lib/lib.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/lib.h') diff --git a/lib/lib.h b/lib/lib.h index 301c50f4..3047d379 100644 --- a/lib/lib.h +++ b/lib/lib.h @@ -154,7 +154,7 @@ ssize_t writeall(int fd, void *buf, size_t len); off_t lskip(int fd, off_t offset); int mkpathat(int atfd, char *dir, mode_t lastmode, int flags); struct string_list **splitpath(char *path, struct string_list **list); -char *readfileat(int dirfd, char *name, char *buf, off_t len); +char *readfileat(int dirfd, char *name, char *buf, off_t *len); char *readfile(char *name, char *buf, off_t len); void msleep(long miliseconds); int64_t peek_le(void *ptr, unsigned size); @@ -256,14 +256,14 @@ void names_to_pid(char **names, int (*callback)(pid_t pid, char *name)); pid_t xvforkwrap(pid_t pid); #define XVFORK() xvforkwrap(vfork()) -#define WOULD_EXIT(y, x) { jmp_buf _noexit; \ +#define WOULD_EXIT(y, x) do { jmp_buf _noexit; \ int _noexit_res; \ toys.rebound = &_noexit; \ _noexit_res = setjmp(_noexit); \ if (!_noexit_res) do {x;} while(0); \ toys.rebound = 0; \ y = _noexit_res; \ -} +} while(0); #define NOEXIT(x) WOULD_EXIT(_noexit_res, x) -- cgit v1.2.3