On Sun, Jul 18, 2021 at 07:46:50PM -0700, Richard Cochran wrote: > On Tue, Jul 13, 2021 at 10:31:16AM +0200, Miroslav Lichvar wrote: > > getopt_long() in glibc allows shortened long option names, e.g. > > ptp4l --domain works as --domainNumber. When the match is ambiguous, > > e.g. --fault matches --fault_badpeernet_interval and > > --fault_reset_interval, it is supposed to return an error, but that > > works only if their struct option have different flags or vals. > > I don't get it... even with your change, all of the 'vals' are zero. > There are not different from one and other. > > > https://sourceware.org/bugzilla/show_bug.cgi?id=28081 > > The last comment says, "you need to use a different val".
The getopt code actually checks all three fields (has_arg, flag and val), not just val. I'll note that in the bug report. -- Miroslav Lichvar _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel