Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  for (i = 0; i < nfds; i++)
    {
      ret = ioctl(fd[i], cmd, 00ul);  /* No argument in this example */
      if (ret < 0)
        {
          int errcode = errno;

...

          if (errcode != ENOTTY)
            {
                            /* Other errors, including EINVAL, are fatal */

              return -errcode
            }
        }
      else if (ret >= 0)
        {

          return OK;  /* Success! */
        }
    }

  return -ENOENT;
}

...