mirror of
https://github.com/systemd/systemd
synced 2024-09-16 06:43:18 +00:00
test-process-util: allow pid to be specified on the command line
This makes it easy to test the query code on "ssh localhost" and similar.
This commit is contained in:
parent
9a140c3564
commit
18dade5aae
|
@ -28,6 +28,7 @@
|
|||
#include "architecture.h"
|
||||
#include "log.h"
|
||||
#include "macro.h"
|
||||
#include "parse-util.h"
|
||||
#include "process-util.h"
|
||||
#include "stdio-util.h"
|
||||
#include "string-util.h"
|
||||
|
@ -150,8 +151,16 @@ int main(int argc, char *argv[]) {
|
|||
log_parse_environment();
|
||||
log_open();
|
||||
|
||||
test_get_process_comm(1);
|
||||
test_get_process_comm(getpid());
|
||||
if (argc > 1) {
|
||||
pid_t pid = 0;
|
||||
|
||||
(void) parse_pid(argv[1], &pid);
|
||||
test_get_process_comm(pid);
|
||||
} else {
|
||||
test_get_process_comm(1);
|
||||
test_get_process_comm(getpid());
|
||||
}
|
||||
|
||||
test_pid_is_unwaited();
|
||||
test_pid_is_alive();
|
||||
test_personality();
|
||||
|
|
Loading…
Reference in a new issue