Changeset b7ee0369 in mainline for uspace/lib/posix/signal.c


Ignore:
Timestamp:
2011-07-31T05:08:44Z (14 years ago)
Author:
Petr Koupy <petr.koupy@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d3e241a
Parents:
051e6ac (diff), 27a8d1d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge libposix changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/signal.c

    r051e6ac rb7ee0369  
    6666
    6767/**
    68  *
    69  * @param signo
     68 * Default signal handler. Executes the default action for each signal,
     69 * as reasonable within HelenOS.
     70 *
     71 * @param signo Signal number.
    7072 */
    7173void __posix_default_signal_handler(int signo)
     
    7577                abort();
    7678        case SIGQUIT:
    77                 fprintf(stderr, "Quit signal raised. Exiting.");
     79                fprintf(stderr, "Quit signal raised. Exiting.\n");
    7880                exit(EXIT_FAILURE);
    7981        case SIGINT:
    80                 fprintf(stderr, "Interrupt signal caught. Exiting.");
     82                fprintf(stderr, "Interrupt signal caught. Exiting.\n");
    8183                exit(EXIT_FAILURE);
    8284        case SIGTERM:
    83                 fprintf(stderr, "Termination signal caught. Exiting.");
     85                fprintf(stderr, "Termination signal caught. Exiting.\n");
    8486                exit(EXIT_FAILURE);
    8587        case SIGSTOP:
    86                 fprintf(stderr, "Stop signal caught, but unsupported. Ignoring.");
     88                fprintf(stderr, "Stop signal caught, but unsupported. Ignoring.\n");
    8789                break;
    8890        case SIGKILL:
     
    250252                    " or fully unsupported signal. This handler may only be"
    251253                    " invoked by the raise() function, which may not be what"
    252                     " the application developer intended.\nSignal name");
     254                    " the application developer intended");
    253255        }
    254256
     
    358360        }
    359361
     362        if (signo > _TOP_SIGNAL) {
     363                errno = EINVAL;
     364                return -1;
     365        }
     366
    360367        if (pid == (posix_pid_t) task_get_id()) {
    361368                return posix_raise(signo);
    362         }
    363 
    364         if (pid > _TOP_SIGNAL) {
    365                 errno = EINVAL;
    366                 return -1;
    367369        }
    368370
Note: See TracChangeset for help on using the changeset viewer.