svn add bb_strtonum.c :(
[oweals/busybox.git] / libbb / create_icmp_socket.c
index d804b39870f7f8d3afbfdb014e968713add0baf3..431c4d8a7bda978a6dbc68f72bfdda32c516cf96 100644 (file)
@@ -2,8 +2,8 @@
 /*
  * Utility routines.
  *
- * create raw socket for icmp protocol test permision
- * and drop root privilegies if running setuid
+ * create raw socket for icmp protocol test permission
+ * and drop root privileges if running setuid
  *
  */
 
@@ -25,13 +25,13 @@ int create_icmp_socket(void)
        if ((sock = socket(AF_INET, SOCK_RAW,
                        (proto ? proto->p_proto : 1))) < 0) {        /* 1 == ICMP */
                if (errno == EPERM)
-                       error_msg_and_die("permission denied. (are you root?)");
+                       bb_error_msg_and_die(bb_msg_perm_denied_are_you_root);
                else
-                       perror_msg_and_die(can_not_create_raw_socket);
+                       bb_perror_msg_and_die(bb_msg_can_not_create_raw_socket);
        }
 
        /* drop root privs if running setuid */
-       setuid(getuid());
+       xsetuid(getuid());
 
        return sock;
 }