+ if (global_options.pid_file)
+ {
+ FILE *pid_file;
+ uint32_t pid;
+
+ pid_file= fopen(global_options.pid_file, "w+");
+
+ if (pid_file == NULL)
+ {
+ perror(strerror(errno));
+ abort();
+ }
+
+ pid= (uint32_t)getpid();
+ fprintf(pid_file, "%u\n", pid);
+ fclose(pid_file);
+ }
+