/[inetutils]/inetutils/ping/ping.c
ViewVC logotype

Diff of /inetutils/ping/ping.c

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

revision 1.10 by ams, Mon Jun 24 17:03:26 2002 UTC revision 1.11 by gray, Fri Aug 9 19:42:27 2002 UTC
# Line 112  main (int argc, char **argv) Line 112  main (int argc, char **argv)
112    u_char *patptr = NULL;    u_char *patptr = NULL;
113    int is_root = getuid () == 0;    int is_root = getuid () == 0;
114    
115      if ((ping = ping_init (ICMP_ECHO, getpid ())) == NULL)
116        {
117          fprintf (stderr, "can't init ping: %s\n", strerror (errno));
118          exit (1);
119        }
120      ping_set_sockopt (ping, SO_BROADCAST, (char *)&one, sizeof (one));
121    
122    /* Parse command line */    /* Parse command line */
123    while ((c = getopt_long (argc, argv, short_options, long_options, NULL))    while ((c = getopt_long (argc, argv, short_options, long_options, NULL))
124           != EOF)           != EOF)
# Line 214  main (int argc, char **argv) Line 221  main (int argc, char **argv)
221          }          }
222      }      }
223    
224      /* Reset root privileges */
225      setuid (getuid ());
226    
227    argc -= optind;    argc -= optind;
228    argv += optind;    argv += optind;
229    if (argc == 0)    if (argc == 0)

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

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