Make enum process_status enumerators uppercase
Rationale: coding style consistency.
diff --git a/sysdeps/linux-gnu/events.c b/sysdeps/linux-gnu/events.c
index 52e2f4f..71d99b6 100644
--- a/sysdeps/linux-gnu/events.c
+++ b/sysdeps/linux-gnu/events.c
@@ -188,7 +188,7 @@
* now) the pain of figuring this out all over again.
* Petr Machata 2011-11-22. */
int i = 0;
- for (; i < 100 && process_status(pid) != ps_tracing_stop; ++i) {
+ for (; i < 100 && process_status(pid) != PS_TRACING_STOP; ++i) {
debug(2, "waiting for %d to stop", pid);
usleep(10000);
}
diff --git a/sysdeps/linux-gnu/proc.c b/sysdeps/linux-gnu/proc.c
index 9f6ef2c..6e01d28 100644
--- a/sysdeps/linux-gnu/proc.c
+++ b/sysdeps/linux-gnu/proc.c
@@ -177,44 +177,45 @@
} while (0)
switch (c) {
- case 'Z': RETURN(ps_zombie);
- case 't': RETURN(ps_tracing_stop);
+ case 'Z': RETURN(PS_ZOMBIE);
+ case 't': RETURN(PS_TRACING_STOP);
case 'T':
/* This can be either "T (stopped)" or, for older
* kernels, "T (tracing stop)". */
if (!strcmp(status, "T (stopped)\n"))
- RETURN(ps_stop);
+ RETURN(PS_STOP);
else if (!strcmp(status, "T (tracing stop)\n"))
- RETURN(ps_tracing_stop);
+ RETURN(PS_TRACING_STOP);
else {
fprintf(stderr, "Unknown process status: %s",
status);
- RETURN(ps_stop); /* Some sort of stop
+ RETURN(PS_STOP); /* Some sort of stop
* anyway. */
}
case 'D':
- case 'S': RETURN(ps_sleeping);
+ case 'S': RETURN(PS_SLEEPING);
}
- RETURN(ps_other);
+ RETURN(PS_OTHER);
#undef RETURN
}
enum process_status
process_status(pid_t pid)
{
- enum process_status ret = ps_invalid;
+ enum process_status ret = PS_INVALID;
FILE * file = open_status_file(pid);
if (file != NULL) {
each_line_starting(file, "State:\t", &process_status_cb, &ret);
fclose(file);
- if (ret == ps_invalid)
+ if (ret == PS_INVALID)
fprintf(stderr, "process_status %d: %s", pid,
strerror(errno));
- } else
+ } else {
/* If the file is not present, the process presumably
* exited already. */
- ret = ps_zombie;
+ ret = PS_ZOMBIE;
+ }
return ret;
}
diff --git a/sysdeps/linux-gnu/trace.c b/sysdeps/linux-gnu/trace.c
index 77dfade..42dd4d9 100644
--- a/sysdeps/linux-gnu/trace.c
+++ b/sysdeps/linux-gnu/trace.c
@@ -217,13 +217,13 @@
* the meantime. This can happen when the whole thread group
* is terminating. */
switch (st) {
- case ps_invalid:
- case ps_tracing_stop:
- case ps_zombie:
+ case PS_INVALID:
+ case PS_TRACING_STOP:
+ case PS_ZOMBIE:
return CBS_CONT;
- case ps_sleeping:
- case ps_stop:
- case ps_other:
+ case PS_SLEEPING:
+ case PS_STOP:
+ case PS_OTHER:
return CBS_STOP;
}
@@ -299,8 +299,8 @@
* vforked process. We set up event handler specially to hint
* us. In that case parent is in D state, which we use to
* weed out unnecessary looping. */
- if (st == ps_sleeping
- && is_vfork_parent (task)) {
+ if (st == PS_SLEEPING
+ && is_vfork_parent(task)) {
task_info->vforked = 1;
return CBS_CONT;
}