Changeset 1404
- Timestamp:
- 10/06/07 21:34:49 (11 months ago)
- Files:
-
- honeytrap/trunk/src/ctrl.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
honeytrap/trunk/src/ctrl.c
r1355 r1404 167 167 /* write master process id to pid file */ 168 168 int create_pid_file(void) { 169 char pid_str[ 5];169 char pid_str[6]; 170 170 171 171 if ((pidfile_fd = open(pidfile_name, O_EXCL | O_CREAT | O_NOCTTY | O_RDWR, 0640)) == -1) { … … 180 180 master_pid = getpid(); 181 181 182 bzero(pid_str, 5);183 snprintf(pid_str, 5,"%d\n", master_pid);184 if ( !(write(pidfile_fd, pid_str, strlen(pid_str)))) {182 bzero(pid_str, 6); 183 snprintf(pid_str, 6,"%d", master_pid); 184 if (write(pidfile_fd, pid_str, strlen(pid_str)) != strlen(pid_str)) { 185 185 logmsg(LOG_ERR, 1, "Error - Unable to write pid file: %m.\n"); 186 186 return(0);
