Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serial back end has inverted SIGTERM block #3649

Closed
michaelrsweet opened this issue Aug 20, 2010 · 6 comments
Closed

Serial back end has inverted SIGTERM block #3649

michaelrsweet opened this issue Aug 20, 2010 · 6 comments
Milestone

Comments

@michaelrsweet
Copy link
Collaborator

Version: 1.4-current
CUPS.org User: bmason

According to the comments in serial.c:

/*

  • Now that we are "connected" to the port, ignore SIGTERM so that we
  • can finish out any page data the driver sends (e.g. to eject the
  • current page... Only ignore SIGTERM if we are printing data from
  • stdin (otherwise you can't cancel raw jobs...)
    */

However, the code after that comment is:

if (print_fd != 0)
{

ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */

sigset(SIGTERM, SIG_IGN);

elif defined(HAVE_SIGACTION)

memset(&action, 0, sizeof(action));

sigemptyset(&action.sa_mask);
action.sa_handler = SIG_IGN;
sigaction(SIGTERM, &action, NULL);

else

signal(SIGTERM, SIG_IGN);

endif /* HAVE_SIGSET */

}

which would seem to operate the opposite of the comments. The result is that you can't stop raw print jobs sent to serial printers.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: bmason

Added proposed patch that makes serial.c match runloop.c

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: bmason

This also seems to be similar to STR #1046.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: bmason

Nuts! Fat-fingered the filename in the first patch. Sorry.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Fixed in Subversion repository.

@michaelrsweet
Copy link
Collaborator Author

"str3469.patch":

Index: serial.c

--- serial.c (revision 9268)
+++ serial.c (working copy)
@@ -503,7 +503,7 @@

  • stdin (otherwise you can't cancel raw jobs...)
    */
  • if (print_fd != 0)
  • if (!print_fd)
    {
    #ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
    sigset(SIGTERM, SIG_IGN);

@michaelrsweet
Copy link
Collaborator Author

"str3649.patch":

Index: serial.c

--- serial.c (revision 9268)
+++ serial.c (working copy)
@@ -503,7 +503,7 @@

  • stdin (otherwise you can't cancel raw jobs...)
    */
  • if (print_fd != 0)
  • if (!print_fd)
    {
    #ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
    sigset(SIGTERM, SIG_IGN);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant