Merge CTDB-related fixes from samba-ctdb 3.0 branch (http://samba.org/~tridge/3_0...
[ddiss/samba.git] / source3 / lib / util.c
index 0653fc9d3f30e35c1646244dfce6f27e884eda7a..bc3eaa8d5e95b8cd600bc7ea62e15534a4dc3a5b 100644 (file)
@@ -505,6 +505,19 @@ bool file_exist(const char *fname,SMB_STRUCT_STAT *sbuf)
        return((S_ISREG(sbuf->st_mode)) || (S_ISFIFO(sbuf->st_mode)));
 }
 
+/*******************************************************************
+ Check if a unix domain socket exists - call vfs_file_exist for samba files.
+********************************************************************/
+
+bool socket_exist(const char *fname)
+{
+       SMB_STRUCT_STAT st;
+       if (sys_stat(fname,&st) != 0) 
+               return(False);
+
+       return S_ISSOCK(st.st_mode);
+}
+
 /*******************************************************************
  Check a files mod time.
 ********************************************************************/