Skip to content

Instantly share code, notes, and snippets.

@oneamtu
Created June 29, 2011 06:15
Show Gist options
  • Save oneamtu/1053256 to your computer and use it in GitHub Desktop.
Save oneamtu/1053256 to your computer and use it in GitHub Desktop.
a roundabout kill command using a call to system()
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