mirror of
https://github.com/troglobit/finit.git
synced 2026-11-13 17:00:16 +00:00
Coding style and whitespace fixes
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
25cc9f3b9b
commit
6448d6ccfa
1 file changed
+6
-6
@@ -262,7 +262,7 @@ char *pid_get_name(pid_t pid, char *name, size_t len)
|
|||||||
* Returns:
|
* Returns:
|
||||||
* Number of signals sent, i.e. number of processes who have received the signal.
|
* Number of signals sent, i.e. number of processes who have received the signal.
|
||||||
*/
|
*/
|
||||||
int procname_kill (char *name, int signo)
|
int procname_kill(char *name, int signo)
|
||||||
{
|
{
|
||||||
int result = 0;
|
int result = 0;
|
||||||
char path[32], line[64];
|
char path[32], line[64];
|
||||||
@@ -276,17 +276,17 @@ int procname_kill (char *name, int signo)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((entry = readdir (dir)) != NULL) {
|
while ((entry = readdir(dir)) != NULL) {
|
||||||
/* Skip non-process entries in /proc */
|
/* Skip non-process entries in /proc */
|
||||||
if (!isdigit (*entry->d_name))
|
if (!isdigit(*entry->d_name))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
snprintf (path, sizeof(path), "/proc/%s/status", entry->d_name);
|
snprintf(path, sizeof(path), "/proc/%s/status", entry->d_name);
|
||||||
/* Skip non-readable files (protected?) */
|
/* Skip non-readable files (protected?) */
|
||||||
if ((fp = fopen (path, "r")) == NULL)
|
if ((fp = fopen(path, "r")) == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (fgets (line, sizeof (line), fp)) {
|
if (fgets(line, sizeof (line), fp)) {
|
||||||
char *pname = line + 6; /* Skip first part of line --> "Name:\t" */
|
char *pname = line + 6; /* Skip first part of line --> "Name:\t" */
|
||||||
|
|
||||||
if (strncmp(pname, name, strlen(pname) - 1) == 0) {
|
if (strncmp(pname, name, strlen(pname) - 1) == 0) {
|
||||||
|
|||||||
Reference in new issue
Block a user