Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 163487 - lp0 read not interruptible by SIGALARM
Summary: lp0 read not interruptible by SIGALARM
Keywords:
Status: CLOSED DUPLICATE of bug 163486
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 3
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-07-18 09:58 UTC by Jean-Jacques Sarton
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-07-18 16:12:39 UTC


Attachments (Terms of Use)

Description Jean-Jacques Sarton 2005-07-18 09:58:15 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Fedora/1.7.8-1.3.1

Description of problem:
The read call on /dev/lp0 is not interrupted by SGIALARM.

The following progam can only be terminated by ^C or kill.
The read call shall be interrupted (an alarm generated via alarm(1)), the
signal is processed but the read call do not return (this was OK on 2.4 kernels)
 
#include <stdio.h>
#include <signal.h>
#include <fcntl.h>

typedef void (*signalHandler_t)(int);
static signalHandler_t sig;
static void _sigAlarm(int code);

static void _sigAlarm(int code)
{
   printf("_sigAlarm got\n");
}

int main(int argc, char **argv)
{
   char *dev = "/dev/lp0";
   char buf[511];
   int  fd;
   int  rd;
   if (argc > 1 )
      dev = argv[1];
   
   fd = open(dev, O_RDWR);
   if (fd > -1 )
   {
      sig = signal(SIGALRM, _sigAlarm);
      alarm(1);
      rd = read(fd, buf,511);
      printf("read -> %d\n",rd);
   }
   return 0;
}


Version-Release number of selected component (if applicable):
kernel-2.6.11-1.35_FC3

How reproducible:
Always

Steps to Reproduce:
1. compile provided example
2. run example
3. 
  

Actual Results:  see above

Expected Results:  the read call shall return after the signal was processed.


Additional info:

All was OK on tzhe 2.4 kernels, the acual behaviour is very bad and all printer
port (USB //) have different (buggy) working mode.

Comment 1 Pete Zaitcev 2005-07-18 16:12:39 UTC

*** This bug has been marked as a duplicate of 163486 ***


Note You need to log in before you can comment on or make changes to this bug.