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/coreutils/uname.c

    r821 r1765  
    11/* vi: set sw=4 ts=4: */
    22/* uname -- print system information
    3    Copyright (C) 1989-1999 Free Software Foundation, Inc.
    4 
    5    This program is free software; you can redistribute it and/or modify
    6    it under the terms of the GNU General Public License as published by
    7    the Free Software Foundation; either version 2, or (at your option)
    8    any later version.
    9 
    10    This program is distributed in the hope that it will be useful,
    11    but WITHOUT ANY WARRANTY; without even the implied warranty of
    12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    13    GNU General Public License for more details.
    14 
    15    You should have received a copy of the GNU General Public License
    16    along with this program; if not, write to the Free Software Foundation,
    17    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
     3 * Copyright (C) 1989-1999 Free Software Foundation, Inc.
     4 *
     5 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
     6 */
    187
    198/* BB_AUDIT SUSv3 compliant */
     
    4231 */
    4332
    44 #include <stdio.h>
    45 #include <stdlib.h>
    46 #include <stddef.h>
    47 #include <string.h>
    48 #include <unistd.h>
    49 #include <sys/types.h>
    5033#include <sys/utsname.h>
    51 #include "busybox.h"
     34#include "libbb.h"
    5235
    5336typedef struct {
     
    5639} uname_info_t;
    5740
    58 static const char options[] = "snrvmpa";
    59 static const unsigned short int utsname_offset[] = {
     41static const char options[] ALIGN1 = "snrvmpa";
     42static const unsigned short utsname_offset[] ALIGN2 = {
    6043    offsetof(uname_info_t,name.sysname),
    6144    offsetof(uname_info_t,name.nodename),
     
    6649};
    6750
     51int uname_main(int argc, char **argv);
    6852int uname_main(int argc, char **argv)
    6953{
     
    7559    char toprint;
    7660
    77     toprint = bb_getopt_ulflags(argc, argv, options);
     61    toprint = getopt32(argv, options);
    7862
    7963    if (argc != optind) {
     
    10387    strcpy(uname_info.processor, "unknown");
    10488
    105     delta=utsname_offset;
     89    delta = utsname_offset;
    10690    do {
    10791        if (toprint & 1) {
    108             bb_printf(((char *)(&uname_info)) + *delta);
     92            printf(((char *)(&uname_info)) + *delta);
    10993            if (toprint > 1) {
    11094                putchar(' ');
     
    11599    putchar('\n');
    116100
    117     bb_fflush_stdout_and_exit(EXIT_SUCCESS);
     101    fflush_stdout_and_exit(EXIT_SUCCESS);
    118102}
Note: See TracChangeset for help on using the changeset viewer.