Style(9) improvements.
This commit is contained in:
parent
63abca411d
commit
fd4a61e809
@ -22,16 +22,16 @@ read_block(int fd, daddr_t block, u_long sector_size)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
foo = malloc(sector_size);
|
foo = malloc(sector_size);
|
||||||
if (!foo)
|
if (foo == NULL)
|
||||||
return NULL;
|
return (NULL);
|
||||||
if (-1 == lseek(fd, (off_t)block * sector_size, SEEK_SET)) {
|
if (-1 == lseek(fd, (off_t)block * sector_size, SEEK_SET)) {
|
||||||
free (foo);
|
free (foo);
|
||||||
return NULL;
|
return (NULL);
|
||||||
}
|
}
|
||||||
i = read(fd, foo, sector_size);
|
i = read(fd, foo, sector_size);
|
||||||
if ((int)sector_size != i) {
|
if ((int)sector_size != i) {
|
||||||
free (foo);
|
free (foo);
|
||||||
return NULL;
|
return (NULL);
|
||||||
}
|
}
|
||||||
return foo;
|
return foo;
|
||||||
}
|
}
|
||||||
@ -42,9 +42,9 @@ write_block(int fd, daddr_t block, const void *foo, u_long sector_size)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (-1 == lseek(fd, (off_t)block * sector_size, SEEK_SET))
|
if (-1 == lseek(fd, (off_t)block * sector_size, SEEK_SET))
|
||||||
return -1;
|
return (-1);
|
||||||
i = write(fd, foo, sector_size);
|
i = write(fd, foo, sector_size);
|
||||||
if ((int)sector_size != i)
|
if ((int)sector_size != i)
|
||||||
return -1;
|
return (-1);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user