git://git.jankratochvil.net
/
debugger.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cc10f96
)
state(): Handle some races.
author
lace
<>
Thu, 12 Apr 2007 19:22:18 +0000
(19:22 +0000)
committer
lace
<>
Thu, 12 Apr 2007 19:22:18 +0000
(19:22 +0000)
debugger.c
patch
|
blob
|
history
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);
}