changeset: 4674:3a4fb8292452
branch: opensaf-4.2.x
parent: 4671:ae0457eebd88
user: Anders Widell <[email protected]>
date: Thu Dec 05 14:02:35 2013 +0100
summary: nid: Fix infinite loops when system calls fail [#645]
changeset: 4675:931feeee43c4
branch: opensaf-4.3.x
parent: 4670:1a342bf1a6b0
user: Anders Widell <[email protected]>
date: Thu Dec 05 14:02:35 2013 +0100
summary: nid: Fix infinite loops when system calls fail [#645]
changeset: 4676:3293fb333eaa
tag: tip
parent: 4673:e63a1963e1ab
user: Anders Widell <[email protected]>
date: Thu Dec 05 14:02:35 2013 +0100
summary: nid: Fix infinite loops when system calls fail [#645]
Node ID 3a4fb82924524285936c51762aeae223bf0d8f7e
Node ID 931feeee43c4e4a96419d04e06e7a1575c8b4602
Node ID 3293fb333eaa0ebeec4075f22e9506402b743544
---
** [tickets:#645] nid: Infinite loops when system calls fail**
**Status:** fixed
**Created:** Mon Dec 02, 2013 02:02 PM UTC by Anders Widell
**Last Updated:** Thu Dec 05, 2013 01:14 PM UTC
**Owner:** Anders Widell
There are several places in nodeinit.c where a while-loop can potentially
become infinite if the system call returns -1. The code looks for example like
this:
while ((n = select(filedes[0] + 1, &set, NULL, NULL, &tv)) <= 0) {
if (n == 0) {
LOG_ER("Writer couldn't return PID");
close(filedes[0]);
return tmp_pid;
}
if (errno == EINTR)
continue;
}
Another example:
while (write(filedes[1], &tmp_pid, sizeof(int)) < 0) {
if (errno == EINTR)
continue;
else if (errno == EPIPE) {
LOG_ER("Reader not available to return my PID");
exit(2);
} else {
LOG_ER("Problem writing to pipe, err=%s",
strerror(errno));
}
}
---
Sent from sourceforge.net because [email protected] is
subscribed to https://sourceforge.net/p/opensaf/tickets/
To unsubscribe from further messages, a project admin can change settings at
https://sourceforge.net/p/opensaf/admin/tickets/options. Or, if this is a
mailing list, you can unsubscribe from the mailing list.------------------------------------------------------------------------------
Sponsored by Intel(R) XDK
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-tickets mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-tickets