Skip to content
This repository
Browse code

o don't trip if PID file cannot be written.

  • Loading branch information...
commit 3b4edf66a0438a5507884cc2669207051b87cd33 1 parent cbf02d7
Henner Zeller authored

Showing 1 changed file with 4 additions and 2 deletions. Show diff stats Hide diff stats

  1. 6  folve-main.cc
6  folve-main.cc
@@ -234,8 +234,10 @@ static int folve_fgetattr(const char *path, struct stat *result,
234 234
 static void *folve_init(struct fuse_conn_info *conn) {
235 235
   if (folve_rt.pid_file) {
236 236
     FILE *p = fopen(folve_rt.pid_file, "w+");
237  
-    fprintf(p, "%d\n", getpid());
238  
-    fclose(p);
  237
+    if (p) {
  238
+      fprintf(p, "%d\n", getpid());
  239
+      fclose(p);
  240
+    }
239 241
   }
240 242
   const int ident_len = 20;
241 243
   char *ident = (char*) malloc(ident_len);  // openlog() keeps reference. Leaks.

0 notes on commit 3b4edf6

Please sign in to comment.
Something went wrong with that request. Please try again.