Lines Matching refs:tmpfd
285 int res = -1, tmpfd, tmpfd2; in execute_action() local
302 if ((tmpfd = creat((char*)args[0], 0755)) == -1) { in execute_action()
307 ftruncate(tmpfd, 1); /* So that mmap() doesn't fool us */ in execute_action()
308 close(tmpfd); in execute_action()
315 if ((tmpfd = open((char*)args[0], O_RDONLY)) == -1) { in execute_action()
320 res = read(tmpfd, &c, 1); in execute_action()
322 close(tmpfd); in execute_action()
325 if ((tmpfd = open((char*)args[0], O_RDWR)) == -1) { in execute_action()
330 res = write(tmpfd, TEST_STRING, strlen(TEST_STRING)); in execute_action()
336 close(tmpfd); in execute_action()
388 if ((tmpfd = open((char*)args[0], O_RDONLY | O_CREAT)) == -1) { in execute_action()
393 res = close(tmpfd); in execute_action()
397 if ((tmpfd = open((char*)args[0], O_RDWR)) == -1) { in execute_action()
402 addr = mmap(0, 20, PROT_WRITE | PROT_READ, MAP_FILE | MAP_SHARED, tmpfd, 0); in execute_action()
410 close(tmpfd); in execute_action()
429 if ((tmpfd = open((char*)args[0], O_RDONLY)) == -1) { in execute_action()
435 close(tmpfd); in execute_action()
438 if ((tmpfd = open((char*)args[0], O_RDONLY)) == -1) { in execute_action()
443 if ((res = flock(tmpfd, LOCK_EX)) == -1) { in execute_action()
445 close(tmpfd); in execute_action()
448 if ((res = flock(tmpfd, LOCK_UN)) == -1) { in execute_action()
450 close(tmpfd); in execute_action()
453 close(tmpfd); in execute_action()