Skip to content
  • Jann - Ove Risvik's avatar
    main/open-iscsi: musl fix for error handling. (bug #4802) · 3d5e7f06
    Jann - Ove Risvik authored and Natanael Copa's avatar Natanael Copa committed
    fixes #4802
    
    Seems like iscsiadm relies on checking optopt for checking if there's an
    error, instead of checking whether opterr is set or if getopt returns
    '?' and then using optopt to retrieve the option that it didn't
    recognize.
    
    For some reason musl sets optopt to the last option parsed even if it
    was valid. Is musl supposed to do that? glibc doesn't behave this way.
    The posix standard for getopt also reads like optopt is only supposed to
    be set when there's an error.
    3d5e7f06