}
/* Check it is read-write. */
ok1(write(fd, buf, strlen(buf)) == strlen(buf));
- lseek(fd, SEEK_SET, 0);
+ lseek(fd, 0, SEEK_SET);
ok1(read(fd, buf, strlen("Hello world!")) == strlen("Hello world!"));
ok1(strcmp(buf, "Hello world!") == 0);
/* Grab ourselves for comparison. */
buf[full_read(fd, buf, sizeof(buf))] = '\0';
- lseek(fd, SEEK_SET, 0);
+ lseek(fd, 0, SEEK_SET);
for (i = 0, p = buf; *p; i++) {
lines[i] = p;
/* Grab ourselves for comparison. */
len = read(fd, buf, sizeof(buf));
buf[len] = '\0';
- lseek(fd, SEEK_SET, 0);
+ lseek(fd, 0, SEEK_SET);
/* We have exact-size buffer, which causes problems adding term. */
rbuf_init(&in, fd, malloc(len), len, test_realloc);
free(rbuf_cleanup(&in));
/* Try again. */
- lseek(fd, SEEK_SET, 0);
+ lseek(fd, 0, SEEK_SET);
rbuf_init(&in, fd, malloc(len), len, test_realloc);
p = rbuf_read_str(&in, 64);
ok1(p);
free(rbuf_cleanup(&in));
/* Normal case, we get rbuf_start after nul */
- lseek(fd, SEEK_SET, 0);
+ lseek(fd, 0, SEEK_SET);
rbuf_init(&in, fd, NULL, 0, test_realloc);
p = rbuf_read_str(&in, '^');
ok1(p);
/* Grab ourselves for comparison. */
len = read(fd, buf, sizeof(buf));
buf[len] = '\0';
- lseek(fd, SEEK_SET, 0);
+ lseek(fd, 0, SEEK_SET);
for (i = 0, p = buf; *p; i++) {
lines[i] = p;
free(rbuf_cleanup(&in));
/* Another way of reading the entire (text) file. */
- lseek(fd, SEEK_SET, 0);
+ lseek(fd, 0, SEEK_SET);
rbuf_init(&in, fd, NULL, 0, test_realloc);
p = rbuf_read_str(&in, 0);
ok1(p);