aboutsummaryrefslogtreecommitdiff
path: root/lib/lib.h
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2015-11-26 21:16:12 -0600
committerRob Landley <rob@landley.net>2015-11-26 21:16:12 -0600
commit12a487b61f809aa4794578e14efe32d717f22bdb (patch)
treee8a824d4d3c7078f98a2a25c204ac4bdc4d0eade /lib/lib.h
parent0f3d8ee513d63282e72df37b97e35ff1a4e4d646 (diff)
downloadtoybox-12a487b61f809aa4794578e14efe32d717f22bdb.tar.gz
Split do_ps() into get_ps() and show_ps() as a start on implementing --sort.
Change readfileat() to pass back length of read.
Diffstat (limited to 'lib/lib.h')
-rw-r--r--lib/lib.h6
1 files changed, 3 insertions, 3 deletions
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)