Subversion Repositories HelenOS

Rev

Rev 3356 | Rev 3364 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3356 Rev 3358
Line 92... Line 92...
92
        return 1;
92
        return 1;
93
    }
93
    }
94
 
94
 
95
    total = lseek(fd, 0, SEEK_END);
95
    total = lseek(fd, 0, SEEK_END);
96
    lseek(fd, 0, SEEK_SET);
96
    lseek(fd, 0, SEEK_SET);
-
 
97
 
97
    if (NULL == (buff = (char *) malloc(blen + 1))) {
98
    if (NULL == (buff = (char *) malloc(blen + 1))) {
98
        close(fd);
99
        close(fd);
99
        printf("Unable to allocate enough memory to read %s\n",
100
        printf("Unable to allocate enough memory to read %s\n",
100
            fname);
101
            fname);
101
        return 1;
102
        return 1;
Line 169... Line 170...
169
        printf("%s - incorrect number of arguments. Try `%s --help'\n",
170
        printf("%s - incorrect number of arguments. Try `%s --help'\n",
170
            cmdname, cmdname);
171
            cmdname, cmdname);
171
        return CMD_FAILURE;
172
        return CMD_FAILURE;
172
    }
173
    }
173
 
174
 
174
    i = optind;
-
 
175
 
-
 
176
    if (buffer <= 0)
175
    if (buffer <= 0)
177
        buffer = CAT_DEFAULT_BUFLEN;
176
        buffer = CAT_DEFAULT_BUFLEN;
178
 
177
 
179
    for (i = optind; argv[i] != NULL; i++)
178
    for (i = optind; argv[i] != NULL; i++)
180
        ret += cat_file(argv[i], buffer);
179
        ret += cat_file(argv[i], buffer);