pid_t pid;
while((pid=waitpid(-1, &status, WNOHANG)) > 0) {
- if(WIFEXITED(&status)) {
+ if(WIFEXITED(status)) {
msg3(LOG_INFO, "Child exited with %d", WEXITSTATUS(status));
}
i=g_hash_table_lookup(children, &pid);
**/
off_t size_autodetect(int fhandle) {
off_t es;
- u32 es32;
+ unsigned long sectors;
struct stat stat_buf;
int error;
#ifdef HAVE_SYS_MOUNT_H
#ifdef HAVE_SYS_IOCTL_H
#ifdef BLKGETSIZE
- DEBUG("looking for fhandle size with ioctl BLKGETSIZE\n");
- if (!ioctl(fhandle, BLKGETSIZE, &es32) && es32) {
- es = (off_t)es32 * (off_t)512;
+ DEBUG("looking for export size with ioctl BLKGETSIZE\n");
+ if (!ioctl(fhandle, BLKGETSIZE, §ors) && sectors) {
+ es = (off_t)sectors * (off_t)512;
return es;
}
#endif /* BLKGETSIZE */
sa.sa_flags = SA_RESTART;
if(sigaction(SIGTERM, &sa, NULL) == -1)
err("sigaction: %m");
- children=g_hash_table_new_full(g_int_hash, g_int_equal, NULL, destroy_pid_t);
}
/**
for(i=0;i<servers->len;i++) {
setup_serve(&(g_array_index(servers, SERVER, i)));
}
+ children=g_hash_table_new_full(g_int_hash, g_int_equal, NULL, destroy_pid_t);
}
/**