git://git.jankratochvil.net
/
debugger.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
state(): Handle some races.
[debugger.git]
/
debugger.c
diff --git
a/debugger.c
b/debugger.c
index
81a3bd4
..
457df84
100644
(file)
--- a/
debugger.c
+++ b/
debugger.c
@@
-102,7
+102,10
@@
static enum state state_get (pid_t pid)
if (f == NULL && errno == ENOENT)
found = STATE_ENOENT;
else if (f == NULL)
if (f == NULL && errno == ENOENT)
found = STATE_ENOENT;
else if (f == NULL)
- crash ();
+ {
+ fprintf (stderr, "errno = %d\n", errno);
+ crash ();
+ }
else
{
int i;
else
{
int i;
@@
-131,9
+134,7
@@
static enum state state_get (pid_t pid)
crash ();
}
}
crash ();
}
}
- if (errno == ESRCH)
- return found;
- assert (found != STATE_INSTABLE);
+ assert (found != STATE_INSTABLE || errno == ESRCH);
i = fclose (f);
assert (i == 0);
}
i = fclose (f);
assert (i == 0);
}