mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
(flags, usage, main): Add noctty flag to dd.
This commit is contained in:
1 parent
2852d59d22
commit
e5526bf63c
1 file changed
+6
-3
@@ -230,6 +230,7 @@ static struct symbol_value const flags[] =
|
||||
{"append", O_APPEND},
|
||||
{"direct", O_DIRECT},
|
||||
{"dsync", O_DSYNC},
|
||||
{"noctty", O_NOCTTY},
|
||||
{"nofollow", O_NOFOLLOW},
|
||||
{"nonblock", O_NONBLOCK},
|
||||
{"sync", O_SYNC},
|
||||
@@ -431,6 +432,9 @@ Each FLAG symbol may be:\n\
|
||||
fputs (_(" nonblock use non-blocking I/O\n"), stdout);
|
||||
if (O_NOFOLLOW)
|
||||
fputs (_(" nofollow do not follow symlinks\n"), stdout);
|
||||
if (O_NOCTTY)
|
||||
fputs (_(" noctty do not assign controlling terminal from file\n"),
|
||||
stdout);
|
||||
fputs (_("\
|
||||
\n\
|
||||
Sending a SIGUSR1 signal to a running `dd' process makes it\n\
|
||||
@@ -1469,8 +1473,7 @@ main (int argc, char **argv)
|
||||
}
|
||||
else
|
||||
{
|
||||
int opts = input_flags | O_NOCTTY;
|
||||
if (open_fd (STDIN_FILENO, input_file, O_RDONLY | opts, 0) < 0)
|
||||
if (open_fd (STDIN_FILENO, input_file, O_RDONLY | input_flags, 0) < 0)
|
||||
error (EXIT_FAILURE, errno, _("opening %s"), quote (input_file));
|
||||
}
|
||||
|
||||
@@ -1488,7 +1491,7 @@ main (int argc, char **argv)
|
||||
{
|
||||
mode_t perms = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
|
||||
int opts
|
||||
= (output_flags | O_NOCTTY
|
||||
= (output_flags
|
||||
| (conversions_mask & C_NOCREAT ? 0 : O_CREAT)
|
||||
| (conversions_mask & C_EXCL ? O_EXCL : 0)
|
||||
| (seek_records || (conversions_mask & C_NOTRUNC) ? 0 : O_TRUNC));
|
||||
|
||||
Reference in new issue
Block a user