[pisa-src] r1604 - in trunk/libpisa: util.c util.h

  • From: Diego Biurrun <diego@xxxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Tue, 10 Nov 2009 15:41:30 +0100

Author: biurrun
Date: Tue Nov 10 15:41:29 2009
New Revision: 1604

Log:
Remove mysterious PISA_CREATE_FILE macro.
The reasons for introducing this macro remain shrouded in mystery.
In the only place where it is used the usage appears buggy.

Modified:
   trunk/libpisa/util.c
   trunk/libpisa/util.h

Modified: trunk/libpisa/util.c
==============================================================================
--- trunk/libpisa/util.c        Tue Nov 10 15:38:07 2009        (r1603)
+++ trunk/libpisa/util.c        Tue Nov 10 15:41:29 2009        (r1604)
@@ -302,7 +302,7 @@
        PISA_IFEL((new_pid_str_len <= 0), -1, "pID length error.\n");
 
        /* Read old pid */
-       fd = PISA_CREATE_FILE(filename);
+       fd = open(filename, O_RDWR | O_CREAT, 0644);
        PISA_IFEL((fd <= 0), -1, "opening lock file failed\n");
 
        if (read(fd, old_pid_str, sizeof(old_pid_str) - 1) < 0) {

Modified: trunk/libpisa/util.h
==============================================================================
--- trunk/libpisa/util.h        Tue Nov 10 15:38:07 2009        (r1603)
+++ trunk/libpisa/util.h        Tue Nov 10 15:41:29 2009        (r1604)
@@ -24,12 +24,6 @@
 
 #include "global.h"
 
-#ifdef CONFIG_PISA_OPENWRT
-# define PISA_CREATE_FILE(x)   creat((x), 0644)
-#else
-# define PISA_CREATE_FILE(x)   open((x), O_RDWR | O_CREAT, 0644)
-#endif
-
 /**
  * Use this macro to detect failures and exit function in case
  * of such. Variable 'err' must be defined, usually type int.

Other related posts:

  • » [pisa-src] r1604 - in trunk/libpisa: util.c util.h - Diego Biurrun