Whamcloud - gitweb
Update changelogs for 1.22.
[tools/e2fsprogs.git] / lib / ss / listen.c
index 765b757..fbd563b 100644 (file)
@@ -6,10 +6,16 @@
  * 
  * Copyright 1987, 1988 by MIT Student Information Processing Board
  *
- * For copyright information, see copyright.h.
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose is hereby granted, provided that
+ * the names of M.I.T. and the M.I.T. S.I.P.B. not be used in
+ * advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission.  M.I.T. and the
+ * M.I.T. S.I.P.B. make no representations about the suitability of
+ * this software for any purpose.  It is provided "as is" without
+ * express or implied warranty.
  */
 
-#include "copyright.h"
 #include "ss_internal.h"
 #include <stdio.h>
 #include <setjmp.h>
@@ -29,7 +35,7 @@ typedef void sigret_t;
 static ss_data *current_info;
 static jmp_buf listen_jmpb;
 
-static sigret_t print_prompt()
+static sigret_t print_prompt(int sig)
 {
 #ifdef BSD
     /* put input into a reasonable mode */
@@ -45,19 +51,18 @@ static sigret_t print_prompt()
     (void) fflush(stdout);
 }
 
-static sigret_t listen_int_handler()
+static sigret_t listen_int_handler(int sig)
 {
     putc('\n', stdout);
     signal(SIGINT, listen_int_handler);
     longjmp(listen_jmpb, 1);
 }
 
-int ss_listen (sci_idx)
-    int sci_idx;
+int ss_listen (int sci_idx)
 {
     char *cp;
     ss_data *info;
-    sigret_t (*sig_int)(), (*sig_cont)(), (*old_sig_cont)();
+    sigret_t (*sig_int)(int), (*sig_cont)(int), (*old_sig_cont)(int);
     char input[BUFSIZ];
     char buffer[BUFSIZ];
     char *end = buffer;
@@ -71,7 +76,7 @@ int ss_listen (sci_idx)
     ss_data *old_info = current_info;
     
     current_info = info = ss_info(sci_idx);
-    sig_cont = (sigret_t (*)()) 0;
+    sig_cont = (sigret_t (*)(int)) 0;
     info->abort = 0;
 #ifdef POSIX_SIGNALS
     sigemptyset(&igmask);
@@ -89,7 +94,7 @@ int ss_listen (sci_idx)
     (void) sigsetmask(mask);
 #endif
     while(!info->abort) {
-       print_prompt();
+       print_prompt(0);
        *end = '\0';
        old_sig_cont = sig_cont;
        sig_cont = signal(SIGCONT, print_prompt);
@@ -133,20 +138,14 @@ egress:
     return code;
 }
 
-void ss_abort_subsystem(sci_idx, code)
-    int sci_idx;
-    int code;
+void ss_abort_subsystem(int sci_idx, int code)
 {
     ss_info(sci_idx)->abort = 1;
     ss_info(sci_idx)->exit_status = code;
     
 }
 
-int ss_quit(argc, argv, sci_idx, infop)
-    int argc;
-    char **argv;
-    int sci_idx;
-    pointer infop;
+void ss_quit(int argc, const char * const *argv, int sci_idx, pointer infop)
 {
     ss_abort_subsystem(sci_idx, 0);
 }