" -u --uid=UID real UID of dumped process\n"
" -g --gid=GID real GID of dumped process\n"
" -i --tid=TID TID of thread that triggered core dump\n"
+ " (with short option TID must be specified without spaces)\n"
" -s --signal=SIG number of signal causing dump\n"
" -t --time=TIME time of dump, expressed as seconds since the Epoch\n"
" -l --live get coredump of running process\n"
{"pid", required_argument, NULL, 'p'},
{"uid", required_argument, NULL, 'u'},
{"gid", required_argument, NULL, 'g'},
- {"tid", required_argument, NULL, 'i'},
+ {"tid", optional_argument, NULL, 'i'},
{"signal", required_argument, NULL, 's'},
{"time", required_argument, NULL, 't'},
{"live", no_argument, NULL, 'l'},
{"executable-path", required_argument, NULL, 'E'},
};
- while ((opt = getopt_long(argc, argv, "p:u:g:i:s:t:hlkro:E:", long_options, NULL)) != -1) {
+ while ((opt = getopt_long(argc, argv, "p:u:g:i::s:t:hlkro:E:", long_options, NULL)) != -1) {
switch (opt) {
case 'p':
GET_NUMBER(pid);
gid_set = true;
break;
case 'i':
- GET_NUMBER(tid);
+ if (optarg != NULL)
+ GET_NUMBER(tid);
break;
case 's':
GET_NUMBER(sig);