Mercurial > hg > toybox
diff toys/mkfifo.c @ 237:7cb15eae1664
Zap toylist.h, moving contents of global structures into DEFINE_GLOBALS()
macros in each C file, and making generated/globals.h from that. Rename
"toy" to "this" along the way to avoid toy/toys confusion.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sun, 20 Jan 2008 17:25:44 -0600 |
parents | 163498bf547b |
children | 951110c37fee |
line wrap: on
line diff
--- a/toys/mkfifo.c Sat Jan 19 17:55:45 2008 -0600 +++ b/toys/mkfifo.c Sun Jan 20 17:25:44 2008 -0600 @@ -21,6 +21,12 @@ #include "toys.h" +DEFINE_GLOBALS( + char *mode; +) + +#define TT this.mkfifo + void mkfifo_main(void) { char *arg; @@ -29,8 +35,8 @@ if (toys.optflags) { char *end; - mode = (mode_t)strtol(toy.mkfifo.mode, &end, 8); - if (end<=toy.mkfifo.mode || *end || mode<0 || mode>0777) + mode = (mode_t)strtol(TT.mode, &end, 8); + if (end<=TT.mode || *end || mode<0 || mode>0777) error_exit("Invalid mode"); } else mode = 0644;