debug
This commit is contained in:
parent
69d73a85bd
commit
99584b3fb0
8
main.c
8
main.c
@ -66,6 +66,7 @@ int getprocinfo( int ppid, char cmdline[], char cmd[], char user[] )
|
|||||||
int pid = ppid;
|
int pid = ppid;
|
||||||
int level = 0;
|
int level = 0;
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
|
char * pos;
|
||||||
|
|
||||||
while ( flag == 0)
|
while ( flag == 0)
|
||||||
{
|
{
|
||||||
@ -121,10 +122,9 @@ int getprocinfo( int ppid, char cmdline[], char cmd[], char user[] )
|
|||||||
perror(child_path);
|
perror(child_path);
|
||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
fscanf( fh1, "%s", str);
|
fgets( str, 1024, fh1);
|
||||||
pch = strtok( str, "=\0" );
|
pos = strstr( str, "USER=") + 5;
|
||||||
pch = strtok( NULL , "=\0" );
|
sprintf( user, "%s", pos);
|
||||||
sprintf( user, "%s", pch);
|
|
||||||
fclose(fh1);
|
fclose(fh1);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user