- char buffer[1024]; /* Nothing special for number */
- sprintf(buffer, "cat /tmp/%umemc.pid | xargs kill", x);
- /* We have to check the return value of this or the compiler will yell */
- int sys_ret= system(buffer);
- assert(sys_ret != -1);
- sprintf(buffer, "/tmp/%umemc.pid", x);
- unlink(buffer);
+ char file_buffer[PATH_MAX]; /* Nothing special for number */
+ snprintf(file_buffer, sizeof(file_buffer), "/tmp/%umemc.pid", x);
+ kill_file(file_buffer);