BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001418 [BusyBox] Other major always 07-02-07 23:11 07-03-07 03:26
Reporter phire View Status public  
Assigned To BusyBox
Priority normal Resolution no change required  
Status closed   Product Version svn
Summary 0001418: 'More' and 'less' seam to point to 'cat' when cross compiled with uClibc
Description When I cross compile busybox (manually, not with buildroot) with my uClibc x86 toolchain (uClibc 0.9.29 and GCC 4.1.2) More and less are broken.

As far as I can tell, both are compiling, there are no errors or warning in the compile process (except a single warning for find) but when I try to run them I get cat instead.

When I compile the same configration with glibc, more and less work as expected.
Additional Information
Attached Files

- Relationships

- Notes
(0002547)
phire
07-03-07 00:37

I did some checking of the source code, Seams the problem come from Revision 18061:
more: do not mess with "/dev/console" (!);
    fill whole 1st screen (was "screen sans one line");
    fall back to cat if redirected or no ctty
less: fall back to cat if no ctty (was exiting)
resize: cosmetics

uClibc (or at least the version I have) seams to fail to open CURRENT_TTY here:
(line 1333 in miscutils/less.c)

kbd_fd = open(CURRENT_TTY, O_RDONLY);
    if (kbd_fd < 0)
        return bb_cat(argv);
 
(0002548)
phire
07-03-07 01:00

I changed it from open to xopen (which is was before) and it kindly informed me:
        less: can't open '/dev/tty': No such file or directory

I was in the process of working out how to mount the root file system when I came across this problem.

I think its better to inform me that I have a problem, rather than falling back to cat.
 
(0002549)
vda
07-03-07 03:26

If less or more cannot open /dev/tty, they think that they are run in a session without controlling tty (for such session opening /dev/tty fails with ENXIO: open("/dev/tty", O_RDONLY|O_LARGEFILE) = -1 ENXIO (No such device or address)).

But in your case, you simply don't have /dev/tty node created, period. Just create it. Should be like this:

# ls -l /dev/tty
crw-rw-rw- 1 root root 5, 0 Jun 29 19:51 /dev/tty
 

- Issue History
Date Modified Username Field Change
07-02-07 23:11 phire New Issue
07-02-07 23:11 phire Status new => assigned
07-02-07 23:11 phire Assigned To  => BusyBox
07-03-07 00:37 phire Note Added: 0002547
07-03-07 01:00 phire Note Added: 0002548
07-03-07 03:26 vda Note Added: 0002549
07-03-07 03:26 vda Status assigned => closed
07-03-07 03:26 vda Resolution open => no change required


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker