浏览代码

* Don't bother locking the oident file if flock() doesn't work [solaris]

Bryan Drewery 16 年之前
父节点
当前提交
e5d7bf992c
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/dccutil.c

+ 4 - 0
src/dccutil.c

@@ -995,7 +995,9 @@ identd_open(const char *sourceIp, const char *destIp, int identd)
       ;
 
     if (f) {
+#ifdef LOCK_EX
       flock(fileno(f), LOCK_EX);
+#endif
       fseek(f, 0, SEEK_SET);
 
       char inbuf[100] = "", outbuf[2048] = "";
@@ -1037,7 +1039,9 @@ identd_open(const char *sourceIp, const char *destIp, int identd)
       
 failure:
       fflush(f);
+#ifdef LOCK_EX
       flock(fileno(f), LOCK_UN);
+#endif
       fclose(f);
     }
   }