From c2d8e184f8aaeb40c845cfcd360b3934eb73405c Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 31 Jan 2023 08:30:47 -0800 Subject: [PATCH] nohup: use the same mode constant for open() and xcreate(). The open() call was the only remaining use of the named permission constants, and the equivalent permissions are given in octal just a couple of lines later. This seems like a solid entry for the next toybox release's pedantry award. --- toys/posix/nohup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toys/posix/nohup.c b/toys/posix/nohup.c index e39b6b60..48eb38c6 100644 --- a/toys/posix/nohup.c +++ b/toys/posix/nohup.c @@ -24,7 +24,7 @@ void nohup_main(void) xsignal(SIGHUP, SIG_IGN); if (isatty(1)) { close(1); - if (-1 == open("nohup.out", O_CREAT|O_APPEND|O_WRONLY, S_IRUSR|S_IWUSR)) { + if (open("nohup.out", O_CREAT|O_APPEND|O_WRONLY, 0600) == -1) { char *temp = getenv("HOME"); xcreate(temp ? temp = xmprintf("%s/nohup.out", temp) : "nohup.out", -- 2.39.2