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/freeramdisk.c

    r821 r1765  
    77 * Unified with fdflush by Tito Ragusa <farmatito@tiscali.it>
    88 *
    9  * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
     9 * Licensed under GPLv2, see file LICENSE in this tarball for details.
    1010 */
    1111
    12 #include <stdio.h>
    13 #include <string.h>
    14 #include <sys/types.h>
    15 #include <fcntl.h>
    16 #include <sys/ioctl.h>
    17 #include <stdlib.h>
    18 #include <unistd.h>
    19 #include "busybox.h"
     12#include "libbb.h"
    2013
    2114/* From <linux/fd.h> */
    2215#define FDFLUSH  _IO(2,0x4b)
    2316
     17int freeramdisk_main(int argc, char **argv);
    2418int freeramdisk_main(int argc, char **argv)
    2519{
    26     int result;
    2720    int fd;
    2821
    2922    if (argc != 2) bb_show_usage();
    3023
    31     fd = bb_xopen(argv[1], O_RDWR);
     24    fd = xopen(argv[1], O_RDWR);
    3225
    3326    // Act like freeramdisk, fdflush, or both depending on configuration.
    34     result = ioctl(fd, (ENABLE_FREERAMDISK && bb_applet_name[1]=='r')
    35             || !ENABLE_FDFLUSH ? BLKFLSBUF : FDFLUSH);
     27    ioctl_or_perror_and_die(fd, (ENABLE_FREERAMDISK && applet_name[1]=='r')
     28            || !ENABLE_FDFLUSH ? BLKFLSBUF : FDFLUSH, NULL, "%s", argv[1]);
    3629
    3730    if (ENABLE_FEATURE_CLEAN_UP) close(fd);
    3831
    39     if (result) bb_perror_msg_and_die("%s", argv[1]);
    4032    return EXIT_SUCCESS;
    4133}
Note: See TracChangeset for help on using the changeset viewer.