chiark / gitweb /
Import release 0.1.10
[secnet.git] / secnet.c
index 489e0bf381e3686acb28433d4077dab953c78e66..a3cf15334d32e60fd2122567878982203693b283 100644 (file)
--- a/secnet.c
+++ b/secnet.c
@@ -106,7 +106,7 @@ static void parse_options(int argc, char **argv)
            break;
 
        case 'v':
-           message_level|=M_INFO|M_NOTICE|M_WARNING|M_ERROR|M_SECURITY|
+           message_level|=M_INFO|M_NOTICE|M_WARNING|M_ERR|M_SECURITY|
                M_FATAL;
            break;
 
@@ -141,12 +141,12 @@ static void parse_options(int argc, char **argv)
            break;
 
        default:
-           Message(M_ERROR,"secnet: Unknown getopt code %c\n",c);
+           Message(M_ERR,"secnet: Unknown getopt code %c\n",c);
        }
     }
 
     if (argc-optind != 0) {
-       Message(M_ERROR,"secnet: You gave extra command line parameters, "
+       Message(M_ERR,"secnet: You gave extra command line parameters, "
                "which were ignored.\n");
     }
 }
@@ -342,6 +342,10 @@ static void droppriv(void)
        } else if (p==0) {
            /* Child process - all done, just carry on */
            if (pf) fclose(pf);
+           /* Close stdin, stdout and stderr; we don't need them any more */
+           close(0);
+           close(1);
+           close(2);
            secnet_is_daemon=True;
        } else {
            /* Error */