这个问题是关于process.exitValue()的值。
如果process.exitValue() = 0 没问题,如果它是-1 有什么问题,但如果是别的什么是什么意思?例如,我正在服用6。那是我使用的代码:
Process process = Runtime.getRuntime().exec(command);
process.waitFor();
Integer result = process.exitValue();
Run Code Online (Sandbox Code Playgroud)
编辑:如果进程挂起,比process.exitValue() = 6
我在用C语言编写代码时使用malloc,但我得到了
[警告]内置函数'malloc'的冲突类型
编译时这个警告.
这是我使用的代码:
starttimer(AorB,increment)
int AorB; /* A or B is trying to stop timer */
float increment;
{
struct event *q;
struct event *evptr;
char *malloc();
if (TRACE>2)
printf(" START TIMER: starting timer at %f\n",time);
/* be nice: check to see if timer is already started, if so, then warn */
/* for (q=evlist; q!=NULL && q->next!=NULL; q = q->next) */
for (q=evlist; q!=NULL ; q = q->next)
if ( (q->evtype==TIMER_INTERRUPT && q->eventity==AorB) ) {
printf("Warning: attempt to …Run Code Online (Sandbox Code Playgroud)