summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Pepper <timothy.c.pepper@linux.intel.com>2012-10-04 15:16:37 -0700
committerTim Pepper <timothy.c.pepper@linux.intel.com>2012-10-04 15:16:37 -0700
commit09517f61202ae412ee2317d46eb0d2506d9adb12 (patch)
tree117bbb596ff0d6c4a04cdbbb4250ebe1facebd77
parent1bb4db3254caea2028c0eef68d441f834a9d5893 (diff)
downloadcorewatcher-09517f61202ae412ee2317d46eb0d2506d9adb12.tar.gz
corewatcher-09517f61202ae412ee2317d46eb0d2506d9adb12.tar.bz2
corewatcher-09517f61202ae412ee2317d46eb0d2506d9adb12.zip
Remove unused global state
Previously this global state needed to be global. It is essentially unused now and would have needed locking if it were used. Simply push it down into the sole function which uses it now. Signed-off-by: Tim Pepper <timothy.c.pepper@linux.intel.com>
-rw-r--r--src/coredump.c4
-rw-r--r--src/corewatcher.h2
-rw-r--r--src/find_file.c2
3 files changed, 2 insertions, 6 deletions
diff --git a/src/coredump.c b/src/coredump.c
index 3bc7540..ee141e7 100644
--- a/src/coredump.c
+++ b/src/coredump.c
@@ -36,15 +36,11 @@
#include <sys/stat.h>
#include <sys/time.h>
#include <dirent.h>
-#include <signal.h>
#include <glib.h>
#include <errno.h>
#include "corewatcher.h"
-int uid = 0;
-int sig = 0;
-
const char *core_folder = "/var/lib/corewatcher/";
const char *processed_folder = "/var/lib/corewatcher/processed/";
diff --git a/src/corewatcher.h b/src/corewatcher.h
index d8e1c10..a503d2a 100644
--- a/src/corewatcher.h
+++ b/src/corewatcher.h
@@ -76,8 +76,6 @@ extern int scan_corefolders(void * unused);
extern char *strip_directories(char *fullpath);
extern char *get_core_filename(char *filename, char *ext);
extern void remove_name_from_hash(char *fullpath, GHashTable *ht);
-extern int uid;
-extern int sig;
extern const char *core_folder;
extern const char *processed_folder;
diff --git a/src/find_file.c b/src/find_file.c
index b04f1af..9760ef7 100644
--- a/src/find_file.c
+++ b/src/find_file.c
@@ -107,6 +107,7 @@ char *find_coredump(char *fullpath)
if (c) {
c += 6;
if (c < line_len) {
+ int uid;
sscanf(c, "%i", &uid);
fprintf(stderr, "+ uid: %d\n", uid);
}
@@ -116,6 +117,7 @@ char *find_coredump(char *fullpath)
if (c) {
c += 8;
if (c < line_len) {
+ int sig;
sscanf(c, "%i", &sig);
fprintf(stderr, "+ sig: %d\n", sig);
}