~ubuntu-branches/ubuntu/trusty/util-linux/trusty-proposed

« back to all changes in this revision

Viewing changes to sys-utils/readprofile.c

  • Committer: Package Import Robot
  • Author(s): LaMont Jones
  • Date: 2011-11-03 15:38:23 UTC
  • mto: (4.5.5 sid) (1.6.4)
  • mto: This revision was merged to the branch mainline in revision 85.
  • Revision ID: package-import@ubuntu.com-20111103153823-10sx16jprzxlhkqf
ImportĀ upstreamĀ versionĀ 2.20.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
122
122
        FILE *map;
123
123
        int proFd;
124
124
        char *mapFile, *proFile, *mult=0;
125
 
        unsigned long len=0, indx=1;
 
125
        size_t len=0, indx=1;
126
126
        unsigned long long add0=0;
127
127
        unsigned int step;
128
128
        unsigned int *buf, total, fn_len;
130
130
        char fn_name[S_LEN], next_name[S_LEN];   /* current and next name */
131
131
        char mode[8];
132
132
        int c;
 
133
        ssize_t rc;
133
134
        int optAll=0, optInfo=0, optReset=0, optVerbose=0, optNative=0;
134
135
        int optBins=0, optSub=0;
135
136
        char mapline[S_LEN];
230
231
 
231
232
        buf = xmalloc(len);
232
233
 
233
 
        if (read(proFd,buf,len) != len) {
 
234
        rc = read(proFd,buf,len);
 
235
        if (rc < 0 || (size_t) rc != len) {
234
236
                fprintf(stderr,"%s: %s: %s\n",prgname,proFile,strerror(errno));
235
237
                exit(1);
236
238
        }
238
240
 
239
241
        if (!optNative) {
240
242
                int entries = len/sizeof(*buf);
241
 
                int big = 0,small = 0,i;
 
243
                int big = 0,small = 0;
242
244
                unsigned *p;
 
245
                size_t i;
243
246
 
244
247
                for (p = buf+1; p < buf+entries; p++) {
245
248
                        if (*p & ~0U << (sizeof(*buf)*4))