Created
June 29, 2011 06:15
-
-
Save oneamtu/1053256 to your computer and use it in GitHub Desktop.
a roundabout kill command using a call to system()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FILE *output = popen("su -c 'cat /var/lock/naoqi.lock'", "r"); | |
char buffer[256]; | |
fgets(buffer, sizeof(buffer), output); | |
char command[256] = "kill -9 "; | |
strcat(command, buffer); | |
printf("command %s\n", command); | |
system(command); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment