Re: [PATCH 00/10] pull: various change, some options related

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

 



On Sun, Apr 23, 2017 at 09:58:11PM +0100, Sami Kerola wrote:
> The chfn and chsh is about usability provided by readline().  I did not add
> #ifdev HAVE_LIBREADLINE and make none libreadline compilation to work
> because it looks like sfdisk is doing the same.  Let me know if fallback
> should be made to work.

Are you sure?

$ grep HAVE_LIBREADLINE disk-utils/sfdisk.c
#ifdef HAVE_LIBREADLINE
#ifdef HAVE_LIBREADLINE
#ifdef HAVE_LIBREADLINE
#ifdef HAVE_LIBREADLINE
#ifndef HAVE_LIBREADLINE

 ... we want to be independent on libreadline of course and it's also
 important to keep the utils usable when stdin is not terminal. We use
 for example:


#ifdef HAVE_LIBREADLINE
	if (isatty(STDIN_FILENO)) {
		p = readline(prompt);
		if (!p)
			return 1;
		memcpy(buf, p, bufsz);
		free(p);
	} else
#endif
	{
		fputs(prompt, stdout);
		fflush(stdout);

		if (!fgets(buf, bufsz, stdin))
			return 1;
	}

for sfdisk.

    Karel
-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" 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