Re: [PATCH] ldattach(8)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 05, 2008 at 07:57:08PM -0500, Mike Frysinger wrote:
> On Tuesday 05 February 2008, Karel Zak wrote:
> > On Tue, Feb 05, 2008 at 06:49:41PM -0500, Mike Frysinger wrote:
> > > On Tuesday 05 February 2008, Tilman Schmidt wrote:
> > > > +	    fprintf(stderr, "%s: bad line discipline: %s\n", prog, optarg);
> > > > +	    exit(EXIT_FAILURE);
> > > > ...
> > > > +	fprintf(stderr, "%s: cannot open %s: %s\n", prog, dev,
> > > > strerror(errno)); +	exit(EXIT_FAILURE);
> > > > ...
> > > > +	fprintf(stderr, "%s: %s is not a serial line\n", prog, dev);
> > > > +	exit(EXIT_FAILURE);
> > > > ...
> > > > +	fprintf(stderr, "%s: cannot set %s to exclusive mode: %s\n",
> > > > +		prog, dev, strerror(errno));
> > > > +	exit(EXIT_FAILURE);
> > > > ...
> > > > +	fprintf(stderr, "%s: cannot get terminal attributes for %s: %s\n",
> > > > +		prog, dev, strerror(errno));
> > > > +	exit(EXIT_FAILURE);
> > > > ...
> > > > <many more>
> > >
> > > could do with writing an error function and/or macro to make things
> > > cleaner
> >
> >  #include <err.h> ... err()  -- very luxury function:
> >
> >     err("cannot get terminal attributes for %s", dev);
> >
> >  that's all...
> 
> hrm, that's a GNU-extension not in POSIX ... but if there's no other 
> attractive alternatives, that's fine.  i bet gnulib has a local version for 
> people to fall back on if the system libc does not provide it ...

 I think we have already talked about supported libc versions. The
 list is very short -- glibc and uClibc (someone also suggested klibc
 and dietlibc but I don't think it's real wish for now).

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
-
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux