On Sun, May 9, 2010 at 9:28 AM, Edd Barrett <vex...@gmail.com> wrote: > +#if defined(__OpenBSD__) > -+ if (close(apm_fd) == -1) > ++ if ((apm_fd != NULL) && (close(apm_fd) == -1)) > + warn("cannot close /dev/apm"); > +#endif
It seems wrong to use NULL (a pointer value) as a file descriptor value. Can I suggest changing apm_fd's initialization from NULL to -1, and similarly comparing against -1 instead of NULL here?