Ignore:
Timestamp:
Feb 25, 2011, 9:26:54 PM (13 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mindi-busybox/libbb/u_signal_names.c

    r1765 r2725  
    55 * Copyright 2006 Rob Landley <rob@landley.net>
    66 *
    7  * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
     7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
    88 */
    99
    1010#include "libbb.h"
    1111
    12 static const char signals[32][7] = {
     12/* Believe it or not, but some arches have more than 32 SIGs!
     13 * HPPA: SIGSTKFLT == 36. */
     14
     15static const char signals[][7] = {
    1316    // SUSv3 says kill must support these, and specifies the numerical values,
    1417    // http://www.opengroup.org/onlinepubs/009695399/utilities/kill.html
    15     // TODO: "[SIG]EXIT" shouldn't work for kill, right?
    1618    // {0, "EXIT"}, {1, "HUP"}, {2, "INT"}, {3, "QUIT"},
    1719    // {6, "ABRT"}, {9, "KILL"}, {14, "ALRM"}, {15, "TERM"}
     
    2123    // {SIGCONT, "CONT"}, {SIGSTOP, "STOP"}, {SIGTSTP, "TSTP"}, {SIGTTIN, "TTIN"},
    2224    // {SIGTTOU, "TTOU"}
     25
    2326    [0] = "EXIT",
    2427#ifdef SIGHUP
     
    119122// Convert signal name to number.
    120123
    121 int get_signum(const char *name)
     124int FAST_FUNC get_signum(const char *name)
    122125{
    123     int i;
     126    unsigned i;
    124127
    125128    i = bb_strtou(name, NULL, 10);
     
    133136
    134137#if ENABLE_DESKTOP && (defined(SIGIOT) || defined(SIGIO))
    135     /* These are aliased to other names */
     138    /* SIGIO[T] are aliased to other names,
     139     * thus cannot be stored in the signals[] array.
     140     * Need special code to recognize them */
    136141    if ((name[0] | 0x20) == 'i' && (name[1] | 0x20) == 'o') {
    137142#ifdef SIGIO
     
    151156// Convert signal number to name
    152157
    153 const char *get_signame(int number)
     158const char* FAST_FUNC get_signame(int number)
    154159{
    155160    if ((unsigned)number < ARRAY_SIZE(signals)) {
     
    160165    return itoa(number);
    161166}
     167
     168
     169// Print the whole signal list
     170
     171void FAST_FUNC print_signames(void)
     172{
     173    unsigned signo;
     174
     175    for (signo = 1; signo < ARRAY_SIZE(signals); signo++) {
     176        const char *name = signals[signo];
     177        if (name[0])
     178            puts(name);
     179    }
     180}
Note: See TracChangeset for help on using the changeset viewer.