Retourner au contenu associé (entrée de forum : Ctrl-c ne fonctionne pas)
Posté par left le 20 juin 2007 à 16:47. En réponse au message Ctrl-c ne fonctionne pas. Évalué à 1.
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
[^] # Re: busybox
Posté par left . En réponse au message Ctrl-c ne fonctionne pas. Évalué à 1.
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
typedef void (*sighandler_t)(int);
int main (int argc, char *argv[])
{
++argv;
if (*argv) {
sighandler_t hook = signal (SIGINT, SIG_DFL);
if (hook==SIG_DFL)
fprintf (stderr, "SIGINT handler was DFL\n");
else if (hook==SIG_IGN)
fprintf (stderr, "SIGINT handler was IGN\n");
execvp (*argv, argv);
}
return 0;
}
Chez moi:
# plop sh
SIGINT handler was IGN
BusyBox v0.60.4 (2003) Built-in shell (ash)
Enter 'help' for a list of built-in commands.
#
Si ça ne fonctionne pas, alors creuses l'autre piste du inittab.