/[man-db]/man-db/src/man.c
ViewVC logotype

Diff of /man-db/src/man.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.93 by cjwatson, Thu May 1 16:41:12 2003 UTC revision 1.94 by cjwatson, Thu May 1 18:14:11 2003 UTC
# Line 144  extern int errno; Line 144  extern int errno;
144  #include "manp.h"  #include "manp.h"
145  #include "security.h"  #include "security.h"
146  #include "encodings.h"  #include "encodings.h"
147    #include "convert_name.h"
148  #include "man.h"  #include "man.h"
149    
150  #ifdef SECURE_MAN_UID  #ifdef SECURE_MAN_UID
# Line 486  static void gripe_no_name (const char *s Line 487  static void gripe_no_name (const char *s
487  static struct termios tms;  static struct termios tms;
488  static int tms_set = 0;  static int tms_set = 0;
489    
490  void set_term ()  static void set_term (void)
491  {  {
492          if (tms_set)          if (tms_set)
493                  tcsetattr (0, TCSANOW, &tms);                  tcsetattr (0, TCSANOW, &tms);
494  }  }
495    
496  void get_term()  static void get_term (void)
497  {  {
498          if (isatty (1)) {          if (isatty (1)) {
499                  if (debug)                  if (debug)
# Line 860  static int local_man_loop (const char *a Line 861  static int local_man_loop (const char *a
861          return exit_status;          return exit_status;
862  }  }
863    
864    static void int_handler (int signo)
865    {
866            if (debug)
867                    fprintf (stderr, "\ninterrupt signal %d handler\n", signo);
868            exit (INTERRUPTED);
869    }
870    
871  int main (int argc, char *argv[])  int main (int argc, char *argv[])
872  {  {
873          int argc_env, exit_status = OK;          int argc_env, exit_status = OK;
# Line 867  int main (int argc, char *argv[]) Line 875  int main (int argc, char *argv[])
875          const char *tmp;          const char *tmp;
876          char *multiple_locale = NULL;          char *multiple_locale = NULL;
877          extern int optind;          extern int optind;
         void (int_handler) (int);  
878    
879          program_name = xstrdup (basename (argv[0]));          program_name = xstrdup (basename (argv[0]));
880    
# Line 939  int main (int argc, char *argv[]) Line 946  int main (int argc, char *argv[])
946          if (external)          if (external)
947                  do_extern (argv);                  do_extern (argv);
948    
949          get_term(); /* stores terminal settings */          get_term (); /* stores terminal settings */
950  #ifdef SECURE_MAN_UID  #ifdef SECURE_MAN_UID
951          if (debug)          if (debug)
952                  fprintf (stderr, "real user = %d; effective user = %d\n",                  fprintf (stderr, "real user = %d; effective user = %d\n",
# Line 1498  static char *make_roff_command (const ch Line 1505  static char *make_roff_command (const ch
1505                  /* Ignore SIGPIPE; we want to be notified by write returning                  /* Ignore SIGPIPE; we want to be notified by write returning
1506                   * EPIPE.                   * EPIPE.
1507                   */                   */
1508                  RETSIGTYPE (*old_handler)() = signal (SIGPIPE, SIG_IGN);                  RETSIGTYPE (*old_handler)(int) = signal (SIGPIPE, SIG_IGN);
1509    
1510                  /* read data into bf; we don't want to use the stream stuff                  /* read data into bf; we don't want to use the stream stuff
1511                   * because we don't want data to be lost in the buffers, not                   * because we don't want data to be lost in the buffers, not
# Line 2019  static __inline__ FILE *open_cat_stream Line 2026  static __inline__ FILE *open_cat_stream
2026    
2027          tmp_cat_file = tmp_cat_filename (cat_file);          tmp_cat_file = tmp_cat_filename (cat_file);
2028          if (!debug)          if (!debug)
2029                  push_cleanup ((void (*)()) unlink, tmp_cat_file);                  push_cleanup ((cleanup_fun) unlink, tmp_cat_file);
2030          created_tmp_cat = 0;          created_tmp_cat = 0;
2031    
2032  #  ifdef COMP_CAT  #  ifdef COMP_CAT
# Line 2166  static int format_display_and_save (cons Line 2173  static int format_display_and_save (cons
2173          FILE *out = checked_popen (disp_cmd, "w");          FILE *out = checked_popen (disp_cmd, "w");
2174          FILE *sav = open_cat_stream (cat_file);          FILE *sav = open_cat_stream (cat_file);
2175          int instat = 1, outstat;          int instat = 1, outstat;
2176          RETSIGTYPE (*old_handler)() = signal (SIGPIPE, SIG_IGN);          RETSIGTYPE (*old_handler)(int) = signal (SIGPIPE, SIG_IGN);
2177    
2178          if (in && out) {          if (in && out) {
2179                  /* copy in to both out and sav */                  /* copy in to both out and sav */
# Line 2334  static void display_catman (const char * Line 2341  static void display_catman (const char *
2341           * (2) else depending on ruid's privs is ok, effectively disables           * (2) else depending on ruid's privs is ok, effectively disables
2342           *     catman for non-root.           *     catman for non-root.
2343           */           */
2344          push_cleanup ((void (*)()) unlink, tmpcat);          push_cleanup ((cleanup_fun) unlink, tmpcat);
2345          status = do_system_drop_privs (cmd);          status = do_system_drop_privs (cmd);
2346          if (status)          if (status)
2347                  gripe_system (cmd, status);                  gripe_system (cmd, status);
# Line 3429  static __inline__ int do_prompt (const c Line 3436  static __inline__ int do_prompt (const c
3436    
3437          return 0;          return 0;
3438  }  }
   
 void int_handler (int signo)  
 {  
         if (debug)  
                 fprintf (stderr, "\ninterrupt signal %d handler\n", signo);  
         exit (INTERRUPTED);  
 }  

Legend:
Removed from v.1.93  
changed lines
  Added in v.1.94

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26