Mercurial > hg > toybox
diff toys/touch.c @ 257:951110c37fee
Add TOYFLAG_UMASK.
author | Rob Landley <rob@landley.net> |
---|---|
date | Tue, 12 Feb 2008 19:05:44 -0600 |
parents | 7cb15eae1664 |
children |
line wrap: on
line diff
--- a/toys/touch.c Tue Feb 12 18:41:34 2008 -0600 +++ b/toys/touch.c Tue Feb 12 19:05:44 2008 -0600 @@ -6,7 +6,7 @@ * * See http://www.opengroup.org/onlinepubs/009695399/utilities/touch.html -USE_TOUCH(NEWTOY(touch, "l#t:r:mca", TOYFLAG_BIN)) +USE_TOUCH(NEWTOY(touch, "l#t:r:mca", TOYFLAG_BIN|TOYFLAG_UMASK)) config TOUCH bool "touch" @@ -86,9 +86,7 @@ if (stat(arg, &sb)) { if (!(toys.optflags & OPT_NOCREATE)) { - int temp = umask(0); xcreate(arg, O_CREAT, 0644); - if (CFG_TOYBOX_FREE) umask(temp); if (stat(arg, &sb)) goto error; }