Sam Varshavchik wrote:

I think that ctlfile should be opened for append mode.

...capital idea. Am I wrong to assume that all of the calls to open() in the openctl() function should have the same flags?



--- courier/submit2.C.orig      Wed Jan 26 18:38:43 2005
+++ courier/submit2.C   Wed Jan 26 18:42:17 2005
@@ -309,7 +309,7 @@
                        current_submit_file=this;
 
                        int nfd=open(filename,
-                                    O_WRONLY | O_TRUNC | O_CREAT | O_EXCL,
+                                    O_WRONLY | O_TRUNC | O_CREAT | O_EXCL | 
O_APPEND,
                                     PERMISSION);
 
                        if (nfd >= 0)
@@ -349,7 +349,7 @@
                                if (w == -1 && errno == ECHILD) break;
 
                        int nfd=open(filename,
-                                    O_WRONLY | O_TRUNC | O_CREAT,
+                                    O_WRONLY | O_TRUNC | O_CREAT | O_EXCL | 
O_APPEND,
                                     PERMISSION);
 
                        if (nfd >= 0)
@@ -362,7 +362,7 @@
                filename=namefile("C", num_control_files_created);
 
                int nfd=open(filename,
-                            O_WRONLY | O_TRUNC | O_CREAT,
+                            O_WRONLY | O_TRUNC | O_CREAT | O_EXCL | O_APPEND,
                             PERMISSION);
 
                if (nfd >= 0)

Reply via email to