OSSP CVS Repository

ossp - Difference in ossp-pkg/l2/l2_ch_file.c versions 1.22 and 1.23
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/l2/l2_ch_file.c 1.22 -> 1.23

--- l2_ch_file.c 2002/03/13 14:49:39     1.22
+++ l2_ch_file.c 2002/07/29 17:42:25     1.23
@@ -86,6 +86,7 @@
 {
     l2_ch_file_t *cfg = (l2_ch_file_t *)ctx->vp;
     int mode;
+    mode_t mask;
 
     /* make sure a path was set */
     if (cfg->path == NULL)
@@ -97,7 +98,10 @@
         mode |= O_APPEND;
     else
         mode |= O_TRUNC;
-    if ((cfg->fd = open(cfg->path, mode, cfg->perm)) == -1)
+    mask = umask(0);
+    cfg->fd = open(cfg->path, mode, cfg->perm);
+    umask(mask);
+    if (cfg->fd == -1)
         return L2_ERR_SYS;
 
     return L2_OK;

CVSTrac 2.0.1