aboutsummaryrefslogtreecommitdiff
path: root/utility.c
diff options
context:
space:
mode:
Diffstat (limited to 'utility.c')
-rw-r--r--utility.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/utility.c b/utility.c
index 0f78f287f..6d1e1d4bb 100644
--- a/utility.c
+++ b/utility.c
@@ -94,6 +94,7 @@ extern void errorMsg(const char *s, ...)
94 94
95 va_start(p, s); 95 va_start(p, s);
96 fflush(stdout); 96 fflush(stdout);
97 fprintf(stderr, "%s: ", applet_name);
97 vfprintf(stderr, s, p); 98 vfprintf(stderr, s, p);
98 va_end(p); 99 va_end(p);
99 fflush(stderr); 100 fflush(stderr);
@@ -105,6 +106,7 @@ extern void fatalError(const char *s, ...)
105 106
106 va_start(p, s); 107 va_start(p, s);
107 fflush(stdout); 108 fflush(stdout);
109 fprintf(stderr, "%s: ", applet_name);
108 vfprintf(stderr, s, p); 110 vfprintf(stderr, s, p);
109 va_end(p); 111 va_end(p);
110 fflush(stderr); 112 fflush(stderr);
@@ -1360,7 +1362,7 @@ extern pid_t* findPidByName( char* pidName)
1360 && (strlen(pidName) == strlen(info.command_line))) { 1362 && (strlen(pidName) == strlen(info.command_line))) {
1361 pidList=realloc( pidList, sizeof(pid_t) * (j+2)); 1363 pidList=realloc( pidList, sizeof(pid_t) * (j+2));
1362 if (pidList==NULL) 1364 if (pidList==NULL)
1363 fatalError(memory_exhausted, ""); 1365 fatalError(memory_exhausted);
1364 pidList[j++]=info.pid; 1366 pidList[j++]=info.pid;
1365 } 1367 }
1366 } 1368 }
@@ -1433,7 +1435,7 @@ extern pid_t* findPidByName( char* pidName)
1433 && (strlen(pidName) == strlen(p))) { 1435 && (strlen(pidName) == strlen(p))) {
1434 pidList=realloc( pidList, sizeof(pid_t) * (i+2)); 1436 pidList=realloc( pidList, sizeof(pid_t) * (i+2));
1435 if (pidList==NULL) 1437 if (pidList==NULL)
1436 fatalError(memory_exhausted, ""); 1438 fatalError(memory_exhausted);
1437 pidList[i++]=strtol(next->d_name, NULL, 0); 1439 pidList[i++]=strtol(next->d_name, NULL, 0);
1438 } 1440 }
1439 } 1441 }
@@ -1450,7 +1452,7 @@ extern void *xmalloc(size_t size)
1450 void *cp = malloc(size); 1452 void *cp = malloc(size);
1451 1453
1452 if (cp == NULL) 1454 if (cp == NULL)
1453 fatalError(memory_exhausted, ""); 1455 fatalError(memory_exhausted);
1454 return cp; 1456 return cp;
1455} 1457}
1456 1458
@@ -1464,7 +1466,7 @@ extern char * xstrdup (const char *s) {
1464 t = strdup (s); 1466 t = strdup (s);
1465 1467
1466 if (t == NULL) 1468 if (t == NULL)
1467 fatalError(memory_exhausted, ""); 1469 fatalError(memory_exhausted);
1468 1470
1469 return t; 1471 return t;
1470} 1472}