Permalink
Browse files

Subject: More fifo handling improvements

Author: Rafi Khardalian

Trac: Refs #98

- Add a check for writability of the fifo on queue requests.

Signed-off-by: Rafi Khardalian <rafi@.>
  • Loading branch information...
rkhardalian
rkhardalian committed Nov 11, 2009
1 parent 5393948 commit 4139610430eaa11d233b9c48793a7464af1080dd
Showing with 7 additions and 1 deletion.
  1. +7 −1 publisher/spine-publisher
@@ -226,11 +226,17 @@ sub add_to_queue
my $rev = shift;
my $fifo = $c->getval('main.fifo');
- unless ( -p $fifo )
+ unless (-p $fifo)
{
plog(LOG_CRIT, "Invalid fifo specified", 1);
}
+ unless (-w $fifo)
+ {
+ plog(LOG_CRIT, "Fifo [$fifo] is not writable", 1);
+ }
+
+
sysopen(QUEUE_FIFO, $fifo, O_RDWR|O_APPEND|O_NONBLOCK);
print QUEUE_FIFO $rev . "\n";
close(QUEUE_FIFO);

0 comments on commit 4139610

Please sign in to comment.