/* Open a device file. */
static int OpenDevice(const char *fullName)
{
int fd = open(fullName, O_RDONLY|O_NONBLOCK);
int flags = O_NONBLOCK;
int fd;
if (s_option) {
flags |= O_RDWR;
} else {
flags |= O_RDONLY;
}
fd = open(fullName, flags);
if (fd == -1) {
fprintf(stderr, _("%s: unable to open `%s'\n"), programName, fullName);
exit(1);