Ignore:
Timestamp:
Nov 4, 2007, 3:16:40 AM (16 years ago)
Author:
Bruno Cornec
Message:

Update to busybox 1.7.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.5/mindi-busybox/util-linux/swaponoff.c

    r821 r1765  
    55 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
    66 *
    7  * Licensed under the GPL v2, see the file LICENSE in this tarball.
     7 * Licensed under the GPL version 2, see the file LICENSE in this tarball.
    88 */
    99
    10 #include "busybox.h"
     10#include "libbb.h"
    1111#include <mntent.h>
    12 #include <dirent.h>
    13 #include <errno.h>
    14 #include <string.h>
    1512#include <sys/swap.h>
    1613
    17 
    18 static int swap_enable_disable(const char *device)
     14static int swap_enable_disable(char *device)
    1915{
    2016    int status;
     
    2319    xstat(device, &st);
    2420
     21#if ENABLE_DESKTOP
    2522    /* test for holes */
    2623    if (S_ISREG(st.st_mode))
    2724        if (st.st_blocks * 512 < st.st_size)
    28             bb_error_msg_and_die("swap file has holes");
     25            bb_error_msg("warning: swap file has holes");
     26#endif
    2927
    30     if (bb_applet_name[5] == 'n')
     28    if (applet_name[5] == 'n')
    3129        status = swapon(device, 0);
    3230    else
     
    6159}
    6260
    63 #define DO_ALL    0x01
    64 
     61int swap_on_off_main(int argc, char **argv);
    6562int swap_on_off_main(int argc, char **argv)
    6663{
     
    7067        bb_show_usage();
    7168
    72     ret = bb_getopt_ulflags(argc, argv, "a");
    73     if (ret & DO_ALL)
     69    ret = getopt32(argv, "a");
     70    if (ret)
    7471        return do_em_all();
    7572
    76     ret = 0;
     73    /* ret = 0; redundant */
    7774    while (*++argv)
    7875        ret += swap_enable_disable(*argv);
Note: See TracChangeset for help on using the changeset viewer.