I recived some help to create a patch. thx My Code created a segmentation foult, it's now fixed.
--- ../x/coreutils-6.9/src/nohup.c 2007-03-18 22:36:43.000000000 +0100 +++ src/nohup.c 2007-04-27 15:39:34.000000000 +0200 @@ -44,6 +44,15 @@ NOHUP_FAILURE = 127 }; +static struct option const long_options[] = + { + {"out-file", required_argument, NULL, 'f'}, + {GETOPT_HELP_OPTION_DECL}, + {GETOPT_VERSION_OPTION_DECL}, + {NULL, 0, NULL, 0} + }; + + char *program_name; void @@ -55,7 +64,7 @@ else { printf (_("\ -Usage: %s COMMAND [ARG]...\n\ +Usage: %s [--out-file=file] COMMAND [ARG]...\n\ or: %s OPTION\n\ "), program_name, program_name); @@ -75,12 +84,14 @@ int main (int argc, char **argv) { + int c = 0; int out_fd = STDOUT_FILENO; int saved_stderr_fd = STDERR_FILENO; bool ignoring_input; bool redirecting_stdout; bool stdout_is_closed; bool redirecting_stderr; + char *file = "nohup.out"; initialize_main (&argc, &argv); program_name = argv[0]; @@ -91,10 +102,28 @@ initialize_exit_failure (NOHUP_FAILURE); atexit (close_stdout); - parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, - usage, AUTHORS, (char const *) NULL); - if (getopt_long (argc, argv, "+", NULL, NULL) != -1) - usage (NOHUP_FAILURE); + if(argc >= 3 && argv[1][0] == '-'){ + if((c = getopt_long (3, argv, "f:", long_options, NULL)) != -1) + { + switch(c) + { + case 'f': + file = strdup(optarg); + break; + + case_GETOPT_HELP_CHAR; + case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); + default: + usage(NOHUP_FAILURE); + } + } + } else { + parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, + usage, AUTHORS, (char const *) NULL); + if (getopt_long (argc, argv, "+", NULL, NULL) != -1) + usage (NOHUP_FAILURE); + } + if (argc <= optind) { @@ -124,7 +153,6 @@ if (redirecting_stdout || (redirecting_stderr && stdout_is_closed)) { char *in_home = NULL; - char const *file = "nohup.out"; int flags = O_CREAT | O_WRONLY | O_APPEND; mode_t mode = S_IRUSR | S_IWUSR; mode_t umask_value = umask (~mode);
_______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils