Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153535711
D36953.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D36953.diff
View Options
diff --git a/usr.sbin/pmcstat/pmcstat.c b/usr.sbin/pmcstat/pmcstat.c
--- a/usr.sbin/pmcstat/pmcstat.c
+++ b/usr.sbin/pmcstat/pmcstat.c
@@ -452,6 +452,7 @@
int do_callchain, do_descendants, do_logproccsw, do_logprocexit;
int do_print, do_read, do_listcounters, do_descr, domains;
int do_userspace, i;
+ int exitcode;
size_t len;
int graphdepth;
int pipefd[2], rfd;
@@ -480,6 +481,7 @@
do_logprocexit = 0;
do_listcounters = 0;
domains = 0;
+ exitcode = EX_OK;
use_cumulative_counts = 0;
graphfilename = "-";
args.pa_required = 0;
@@ -1420,13 +1422,21 @@
* ourselves.
*/
(void) wait(&c);
+ exitcode = EX_IOERR;
runstate = PMCSTAT_FINISHED;
} else if (kev.ident == SIGIO) {
+ struct pmcstat_target *pt;
/*
* We get a SIGIO if a PMC loses all
* of its targets, or if logfile
* writes encounter an error.
*/
+ assert(args.pa_flags & FLAG_HAS_COMMANDLINE);
+ pt = SLIST_FIRST(&args.pa_targets);
+ if (wait4(pt->pt_pid, &c, 0, NULL) <= 0 ||
+ !WIFEXITED(c) || WEXITSTATUS(c) != 0) {
+ exitcode = EX_IOERR;
+ }
runstate = pmcstat_close_log(&args);
do_print = 1; /* print PMCs at exit */
} else if (kev.ident == SIGINT) {
@@ -1516,5 +1526,5 @@
);
}
- exit(EX_OK);
+ exit(exitcode);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 22, 5:48 PM (16 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31991871
Default Alt Text
D36953.diff (1 KB)
Attached To
Mode
D36953: usr.sbin/pmcstat: return non-zero if the launched command fails
Attached
Detach File
Event Timeline
Log In to Comment