]> git.sommitrealweird.co.uk Git - onak.git/blobdiff - add.c
Add Depends on adduser for Debian
[onak.git] / add.c
diff --git a/add.c b/add.c
index 46f5ecf1e926a1553e06320b15acc4b9e40ab65e..167e5bd46aa13a0380fcd8e288eecce19f2cb478 100644 (file)
--- a/add.c
+++ b/add.c
@@ -23,7 +23,6 @@
 #include "merge.h"
 #include "onak-conf.h"
 #include "parsekey.h"
 #include "merge.h"
 #include "onak-conf.h"
 #include "parsekey.h"
-#include "sendsync.h"
 
 int main(int argc, char *argv[])
 {
 
 int main(int argc, char *argv[])
 {
@@ -69,8 +68,13 @@ int main(int argc, char *argv[])
                                count);
                        printf("Storing %d keys.\n", count);
                        end_html();
                                count);
                        printf("Storing %d keys.\n", count);
                        end_html();
-                       fclose(stdout);
-                       fclose(stderr);
+                       if (stdout != NULL && fileno(stdout) != -1) {
+                               fclose(stdout);
+                       }
+                       if (stderr != NULL && stderr != stdout &&
+                                       fileno(stderr) != -1) {
+                               fclose(stderr);
+                       }
                        catchsignals();
                        initdb(false);
                        
                        catchsignals();
                        initdb(false);