~ubuntu-branches/debian/experimental/nfs-utils/experimental

« back to all changes in this revision

Viewing changes to utils/gssd/cacheio.c

  • Committer: Bazaar Package Importer
  • Author(s): Anibal Monsalve Salazar
  • Date: 2006-07-08 14:26:40 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060708142640-r171kjj2a13gy2kz
Tags: 1:1.0.9-1
* Updated co-mantainer mail address.
* New upstream release.
  - Added 'mount.nfs' utility which can be used as a mount helper
    to mount nfs filesystems. It does not yet support 'user' mounts.
  - Makefile/autoconf tidyups
  - No compiles with no warnings
  - deleted debian/* at request of debian maintainer
  - deleted assorted other unused files
  - mountd can be run multi-threaded for configurations with many hundreds
    of clients (mountd -t 20).  Default is single-threaded
  - Support for selection NFS version to be exported, and protocol to
    use.  This requires kernel patches that should be in linux 2.6.19.
  - Use 65534 rather than -2 for default anon.  This makes no difference in many
    cases, but is important in some.
  - New utility 'rpcdebug' for controlled kernel 'debug' options for nfs and nfsd.
  - nfsstat reports NFSv4 operation statistics that should be available in
    linux 2.6.18.
  - assorted other fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
#include <time.h>
56
56
#include <stdlib.h>
57
57
#include <string.h>
 
58
#include <errno.h>
58
59
#include "err_util.h"
59
60
 
60
61
void qword_add(char **bpp, int *lp, char *str)
244
245
        return 0;
245
246
}
246
247
 
 
248
#define READLINE_BUFFER_INCREMENT 2048
 
249
 
247
250
int readline(int fd, char **buf, int *lenp)
248
251
{
249
252
        /* read a line into *buf, which is malloced *len long
254
257
        int len;
255
258
 
256
259
        if (*lenp == 0) {
257
 
                char *b = malloc(128);
 
260
                char *b = malloc(READLINE_BUFFER_INCREMENT);
258
261
                if (b == NULL)
259
262
                        return 0;
260
263
                *buf = b;
261
 
                *lenp = 128;
 
264
                *lenp = READLINE_BUFFER_INCREMENT;
262
265
        }
263
266
        len = read(fd, *buf, *lenp);
264
267
        if (len <= 0) {
265
 
                printerr(2, "read error in readline: %d\n", len);
 
268
                printerr(0, "readline: read error: len %d errno %d (%s)\n",
 
269
                         len, errno, strerror(errno));
266
270
                return 0;
267
271
        }
268
272
        while ((*buf)[len-1] != '\n') {
271
275
         */
272
276
                char *new;
273
277
                int nl;
274
 
                *lenp += 128;
 
278
                *lenp += READLINE_BUFFER_INCREMENT;
275
279
                new = realloc(*buf, *lenp);
276
280
                if (new == NULL)
277
281
                        return 0;
278
282
                *buf = new;
279
283
                nl = read(fd, *buf +len, *lenp - len);
280
284
                if (nl <= 0 ) {
281
 
                        printerr(2, "read error in readline: %d\n", nl);
 
285
                        printerr(0, "readline: read error: len %d "
 
286
                                 "errno %d (%s)\n", nl, errno, strerror(errno));
282
287
                        return 0;
283
288
                }
284
289
                len += nl;
285
290
        }
286
291
        (*buf)[len-1] = 0;
287
 
        printerr(1, "read line with %d characters:\n%s\n", *lenp, *buf);
 
292
        printerr(3, "readline: read %d chars into buffer of size %d:\n%s\n",
 
293
                 len, *lenp, *buf);
288
294
        return 1;
289
295
}