Skip to content
Snippets Groups Projects
Commit 9e120632 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

nicer: use kill() instead of a system() call
parent b114d8ea
No related branches found
No related tags found
No related merge requests found
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <signal.h>
int main(void)
{
int i, pid;
FILE *fp;
char str[32];
for(i = 0; i < 5; i++){
system("gmsh -pid fichier.msh fichier.pos > /tmp/gmsh.pid &");
......@@ -18,7 +18,6 @@ int main(void)
fscanf(fp, "%d", &pid);
fclose(fp);
sprintf(str, "kill %d", pid);
system(str);
kill(pid, 9);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment