files.c (f9343fea) | files.c (696e08c4) |
---|---|
1/*- 2 * Copyright (c) 2010, 2013 The NetBSD Foundation, Inc. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to The NetBSD Foundation 6 * by David A. Holland. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 322 unchanged lines hidden (view full) --- 331int 332file_tryopen(const char *file) 333{ 334 int fd; 335 336 /* XXX check for non-regular files */ 337 338 fd = open(file, O_RDONLY); | 1/*- 2 * Copyright (c) 2010, 2013 The NetBSD Foundation, Inc. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to The NetBSD Foundation 6 * by David A. Holland. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 322 unchanged lines hidden (view full) --- 331int 332file_tryopen(const char *file) 333{ 334 int fd; 335 336 /* XXX check for non-regular files */ 337 338 fd = open(file, O_RDONLY); |
339 if (fd < 0) { | 339 if (fd == -1) { |
340 if (errno != ENOENT && errno != ENOTDIR) { 341 complain(NULL, "%s: %s", file, strerror(errno)); 342 } 343 return -1; 344 } 345 346 return fd; 347} --- 79 unchanged lines hidden --- | 340 if (errno != ENOENT && errno != ENOTDIR) { 341 complain(NULL, "%s: %s", file, strerror(errno)); 342 } 343 return -1; 344 } 345 346 return fd; 347} --- 79 unchanged lines hidden --- |