From a972c49404c18ed15db2c1cce5f414293f73c8d9 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 23 Nov 2007 15:16:55 -0500 Subject: [PATCH] Import 2.1.125pre2 --- Documentation/Configure.help | 27 ++++++++++++++++++++------- MAINTAINERS | 3 +-- Makefile | 8 ++++---- arch/i386/kernel/io_apic.c | 18 ++++++++++++++---- arch/i386/lib/delay.c | 10 ++++++++-- arch/i386/mm/fault.c | 4 ++-- arch/m68k/mac/macints.c | 1 + arch/m68k/mac/via6522.c | 1 - drivers/block/md.c | 1 - drivers/char/console.c | 15 +++++++-------- drivers/char/i2c.c | 2 +- drivers/char/radio-sf16fmi.c | 2 +- drivers/char/saa5249.c | 7 ------- drivers/char/tty_io.c | 20 ++++++++++++++++++-- drivers/char/videodev.c | 2 +- drivers/net/ppp.c | 3 +++ drivers/net/sdla_x25.c | 2 +- drivers/scsi/scsicam.c | 2 ++ include/linux/linkage.h | 2 +- init/main.c | 13 ++++++++++--- ipc/shm.c | 5 +++-- mm/vmscan.c | 3 ++- net/sunrpc/clnt.c | 2 +- scripts/lxdialog/dialog.h | 18 ++++++++++++++++++ scripts/lxdialog/lxdialog.c | 3 +++ scripts/lxdialog/menubox.c | 5 +++++ scripts/lxdialog/textbox.c | 8 ++++++++ 27 files changed, 135 insertions(+), 52 deletions(-) diff --git a/Documentation/Configure.help b/Documentation/Configure.help index 2a02597db..945da3384 100644 --- a/Documentation/Configure.help +++ b/Documentation/Configure.help @@ -225,7 +225,8 @@ CONFIG_BLK_DEV_IDE If you say Y here, you will use the full-featured IDE driver to control up to four IDE interfaces, each being able to serve a "master" and a "slave" device, for a total of up to eight IDE - disk/cdrom/tape/floppy drives. + disk/cdrom/tape/floppy drives. People with SCSI-only systems + should say 'N' here. Useful information about large (>540MB) IDE disks, sound card IDE ports, module support, and other topics, is contained in @@ -256,6 +257,8 @@ CONFIG_BLK_DEV_HD_ONLY more detailed information, read the Disk-HOWTO, available via FTP (user: anonymous) from ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO. + People with SCSI-only systems can say 'N' here. + Use old disk-only driver on primary interface CONFIG_BLK_DEV_HD_IDE There are two drivers for MFM/RLL/IDE disks. Most people use just @@ -270,11 +273,13 @@ CONFIG_BLK_DEV_HD_IDE addresses. Normally, just say N here; you will then use the new driver for all 4 interfaces. + People with SCSI-only systems can say 'N' here. + Include IDE/ATA-2 DISK support CONFIG_BLK_DEV_IDEDISK This will include enhanced support for MFM/RLL/IDE hard disks. If you have a MFM/RLL/IDE disk, and there is no special reason to use the - old hard disk driver instead, say Y. + old hard disk driver instead, say Y. If all your disks are SCSI, say 'N'. If you want to compile this driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), @@ -313,7 +318,7 @@ Include IDE/ATAPI TAPE support CONFIG_BLK_DEV_IDETAPE If you have an IDE tape drive using the ATAPI protocol, say Y. ATAPI is a newer protocol used by IDE tape and CDROM drives, similar - to the SCSI protocol. + to the SCSI protocol (but say 'N' if your tape is a SCSI device). If you say Y here, the tape drive will be identified at boot time along with other IDE devices, as "hdb" or "hdc", or something @@ -363,7 +368,7 @@ CONFIG_BLK_DEV_IDESCSI If both this SCSI emulation and native ATAPI support are compiled into the kernel, the native support will be used. - If unsure, say N. + People with SCSI-only systems should say 'N' here. If unsure, say N. CMD640 chipset bugfix/support CONFIG_BLK_DEV_CMD640 @@ -387,7 +392,9 @@ CONFIG_BLK_DEV_CMD640 The CMD640 chip is also used on add-in cards by Acculogic, and on the "CSA-6400E PCI to IDE controller" that some people have. For - details, read Documentation/ide.txt. If unsure, say Y. + details, read Documentation/ide.txt. + + People with SCSI-only systems should say 'N' here. If unsure, say Y. CMD640 enhanced support CONFIG_BLK_DEV_CMD640_ENHANCED @@ -405,14 +412,18 @@ CONFIG_BLK_DEV_RZ1000 severe data corruption under many conditions. Say Y here to include code which automatically detects and corrects the problem under Linux. This may slow disk throughput by a few percent, but at least - things will operate 100% reliably. If unsure, say Y. + things will operate 100% reliably. + + People with SCSI-only systems can say 'N' here. If unsure, say Y. Generic PCI IDE chipset support CONFIG_BLK_DEV_IDEPCI Enable this for PCI systems which use IDE drive(s). This option helps the IDE driver to automatically detect and configure all PCI-based IDE interfaces in your system. - It is safe to say Y to this question. + + People with SCSI-only systems should say 'N' here. It is safe to + say 'Y' to this question. Generic PCI bus-master DMA support CONFIG_BLK_DEV_IDEDMA @@ -468,6 +479,8 @@ CONFIG_IDE_CHIPSETS chipsets. Most of these also require special kernel boot parameters to actually turn on the support at runtime. + People with SCSI-only systems should say 'N' here. + Generic 4 drives/port support CONFIG_BLK_DEV_4DRIVES Certain older chipsets, including the Tekram 690CD, use a diff --git a/MAINTAINERS b/MAINTAINERS index 79937bda0..71c6087eb 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -57,8 +57,7 @@ L: Mailing list that is relevant to this area W: Web-page with status/info S: Status, one of the following: - Supported: Someone is actually paid to look after this (wildly - improbable). + Supported: Someone is actually paid to look after this. Maintained: Someone actually looks after it. Odd Fixes: It has a maintainer but they don't have time to do much other than throw the odd patch in. See below.. diff --git a/Makefile b/Makefile index 120782f39..cc16579e7 100644 --- a/Makefile +++ b/Makefile @@ -321,10 +321,10 @@ modules_install: if [ -f VIDEO_MODULES ]; then inst_mod VIDEO_MODULES video; fi; \ if [ -f FC4_MODULES ]; then inst_mod FC4_MODULES fc4; fi; \ \ - ls *.o > .allmods; \ - echo $$MODULES | tr ' ' '\n' | sort | comm -23 .allmods - > .misc; \ - if [ -s .misc ]; then inst_mod .misc misc; fi; \ - rm -f .misc .allmods; \ + ls *.o > $$MODLIB/.allmods; \ + echo $$MODULES | tr ' ' '\n' | sort | comm -23 $$MODLIB/.allmods - > $$MODLIB/.misc; \ + if [ -s $$MODLIB/.misc ]; then inst_mod $$MODLIB/.misc misc; fi; \ + rm -f $$MODLIB/.misc $$MODLIB/.allmods; \ ) # modules disabled.... diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c index be0ce3b1a..fa8ef26bb 100644 --- a/arch/i386/kernel/io_apic.c +++ b/arch/i386/kernel/io_apic.c @@ -723,10 +723,20 @@ void __init print_IO_APIC(void) ); } - printk("IRQ to pin mappings:\n"); - for (i = 0; i < PIN_MAP_SIZE; i++) - printk("%d->%d(%d) ", i, irq_2_pin[i].pin, irq_2_pin[i].next); - printk("\n"); + printk(KERN_DEBUG "IRQ to pin mappings:\n"); + for (i = 0; i < NR_IRQS; i++) { + struct irq_pin_list *entry = irq_2_pin + i; + if (entry->pin < 0) + continue; + printk(KERN_DEBUG "IRQ%d ", i); + for (;;) { + printk("-> %d", entry->pin); + if (!entry->next) + break; + entry = irq_2_pin + entry->next; + } + printk("\n"); + } printk(".................................... done.\n"); diff --git a/arch/i386/lib/delay.c b/arch/i386/lib/delay.c index 12b6b4683..ae8aec636 100644 --- a/arch/i386/lib/delay.c +++ b/arch/i386/lib/delay.c @@ -5,7 +5,9 @@ * Copyright (C) 1997 Martin Mares * * The __delay function must _NOT_ be inlined as its execution time - * depends wildly on alignment on many x86 processors. + * depends wildly on alignment on many x86 processors. The additional + * jump magic is needed to get the timing stable on all the CPU's + * we have to worry about. */ #include @@ -18,7 +20,11 @@ void __delay(unsigned long loops) { __asm__ __volatile__( - "1:\tdecl %0\n\tjns 1b" + "\tjmp 1f\n" + ".align 16\n" + "1:\tjmp 2f\n" + ".align 16\n" + "2:\tdecl %0\n\tjns 2b" :/* no outputs */ :"a" (loops) :"ax"); diff --git a/arch/i386/mm/fault.c b/arch/i386/mm/fault.c index 358ff5033..d28005947 100644 --- a/arch/i386/mm/fault.c +++ b/arch/i386/mm/fault.c @@ -103,8 +103,8 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code) tsk = current; mm = tsk->mm; - if (in_interrupt()) - die("page fault from irq handler",regs,error_code); + if (in_interrupt() || mm == &init_mm) + die("page fault without a user context",regs,error_code); down(&mm->mmap_sem); diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c index ac8a66a10..b703cb275 100644 --- a/arch/m68k/mac/macints.c +++ b/arch/m68k/mac/macints.c @@ -69,6 +69,7 @@ * - */ +#include #include #include #include diff --git a/arch/m68k/mac/via6522.c b/arch/m68k/mac/via6522.c index 1e76b343f..08ca49071 100644 --- a/arch/m68k/mac/via6522.c +++ b/arch/m68k/mac/via6522.c @@ -5,7 +5,6 @@ * via them as are assorted bits and bobs - eg rtc, adb. */ -#include #include #include #include diff --git a/drivers/block/md.c b/drivers/block/md.c index b6cf3d34e..847162c03 100644 --- a/drivers/block/md.c +++ b/drivers/block/md.c @@ -696,7 +696,6 @@ static int md_ioctl (struct inode *inode, struct file *file, RO_IOCTLS(inode->i_rdev,arg); default: - printk ("Unknown md_ioctl %d\n", cmd); return -EINVAL; } diff --git a/drivers/char/console.c b/drivers/char/console.c index bd5c3ee7c..6a3b8fbd9 100644 --- a/drivers/char/console.c +++ b/drivers/char/console.c @@ -99,6 +99,7 @@ #include #include #include +#include #include @@ -1962,14 +1963,14 @@ void vt_console_print(struct console *co, const char * b, unsigned count) { int currcons = fg_console; unsigned char c; - static int printing = 0; + static unsigned long printing = 0; const ushort *start; ushort cnt = 0; ushort myx = x; - if (!printable || printing) - return; /* console not yet initialized */ - printing = 1; + /* console busy or not yet initialized */ + if (!printable || test_and_set_bit(0, &printing)) + return; if (kmsg_redirect && vc_cons_allocated(kmsg_redirect - 1)) currcons = kmsg_redirect - 1; @@ -1981,7 +1982,7 @@ void vt_console_print(struct console *co, const char * b, unsigned count) } if (vcmode != KD_TEXT) - return; + goto quit; /* undraw cursor first */ if (IS_FG) @@ -1993,9 +1994,7 @@ void vt_console_print(struct console *co, const char * b, unsigned count) * Problems caused when we have need_wrap set on '\n' character */ disable_bh(CONSOLE_BH); while (count--) { - enable_bh(CONSOLE_BH); c = *b++; - disable_bh(CONSOLE_BH); if (c == 10 || c == 13 || c == 8 || need_wrap) { if (cnt > 0) { if (IS_VISIBLE) @@ -2042,7 +2041,7 @@ void vt_console_print(struct console *co, const char * b, unsigned count) poke_blanked_console(); quit: - printing = 0; + clear_bit(0, &printing); } static kdev_t vt_console_device(struct console *c) diff --git a/drivers/char/i2c.c b/drivers/char/i2c.c index 9741f4be4..851929e94 100644 --- a/drivers/char/i2c.c +++ b/drivers/char/i2c.c @@ -21,7 +21,7 @@ #define I2C_DEBUG(x) if (i2c_debug) (x) static int scan = 0; -static int verbose = 1; +static int verbose = 0; static int i2c_debug = 0; MODULE_PARM(scan,"i"); diff --git a/drivers/char/radio-sf16fmi.c b/drivers/char/radio-sf16fmi.c index 192fa5236..efc6738dd 100644 --- a/drivers/char/radio-sf16fmi.c +++ b/drivers/char/radio-sf16fmi.c @@ -26,7 +26,7 @@ struct fmi_device { int port; int curvol; /* 1 or 0 */ - unsigned long curfreq; /* RSF16_PREC * freq in MHz */ + unsigned long curfreq; /* freq in kHz */ __u32 flags; }; diff --git a/drivers/char/saa5249.c b/drivers/char/saa5249.c index f3185252f..608ac56ba 100644 --- a/drivers/char/saa5249.c +++ b/drivers/char/saa5249.c @@ -149,7 +149,6 @@ static int saa5249_attach(struct i2c_device *device) if(device->bus->id!=I2C_BUSID_BT848) return -EINVAL; - printk(KERN_DEBUG "saa5249_attach: bus %p\n", device->bus); strcpy(device->name, IF_NAME); /* @@ -205,7 +204,6 @@ static int saa5249_attach(struct i2c_device *device) static int saa5249_detach(struct i2c_device *device) { struct video_device *vd=device->data; - printk(KERN_DEBUG "saa5249_detach\n"); video_unregister_device(vd); kfree(vd->priv); kfree(vd); @@ -215,7 +213,6 @@ static int saa5249_detach(struct i2c_device *device) static int saa5249_command(struct i2c_device *device, unsigned int cmd, void *arg) { - printk(KERN_DEBUG "saa5249_command\n"); return -EINVAL; } @@ -621,11 +618,9 @@ static int saa5249_open(struct video_device *vd, int nb) struct saa5249_device *t=vd->priv; int pgbuf; - printk("t=%p\n",t); if (t->bus==NULL) return -ENODEV; - printk("Do i2c %p\n",t->bus); if (i2c_senddata(t, CCTWR, 0, 0, -1) || /* Select R11 */ /* Turn off parity checks (we do this ourselves) */ i2c_senddata(t, CCTWR, 1, disp_modes[t->disp_mode][0], 0, -1) || @@ -636,7 +631,6 @@ static int saa5249_open(struct video_device *vd, int nb) return -EIO; } - printk("clean\n"); for (pgbuf = 0; pgbuf < NUM_DAUS; pgbuf++) { memset(t->vdau[pgbuf].pgbuf, ' ', sizeof(t->vdau[0].pgbuf)); @@ -648,7 +642,6 @@ static int saa5249_open(struct video_device *vd, int nb) t->is_searching[pgbuf] = FALSE; } t->virtual_mode=FALSE; - printk("Go\n"); MOD_INC_USE_COUNT; return 0; } diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index e8b116fbd..2a2f2deea 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -390,7 +390,9 @@ void do_tty_hangup(void *data) { struct tty_struct *tty = (struct tty_struct *) data; struct file * filp; + struct file * cons_filp = NULL; struct task_struct *p; + int closecount = 0, n; if (!tty) return; @@ -407,10 +409,13 @@ void do_tty_hangup(void *data) if (!filp->f_dentry->d_inode) continue; if (filp->f_dentry->d_inode->i_rdev == CONSOLE_DEV || - filp->f_dentry->d_inode->i_rdev == SYSCONS_DEV) + filp->f_dentry->d_inode->i_rdev == SYSCONS_DEV) { + cons_filp = filp; continue; + } if (filp->f_op != &tty_fops) continue; + closecount++; tty_fasync(-1, filp, 0); filp->f_op = &hung_up_tty_fops; } @@ -470,7 +475,17 @@ void do_tty_hangup(void *data) tty->session = 0; tty->pgrp = -1; tty->ctrl_status = 0; - if (tty->driver.hangup) + /* + * If one of the devices matches a console pointer, we + * cannot just call hangup() because that will cause + * tty->count and state->count to go out of sync. + * So we just call close() the right number of times. + */ + if (cons_filp) { + if (tty->driver.close) + for (n = 0; n < closecount; n++) + tty->driver.close(tty, cons_filp); + } else if (tty->driver.hangup) (tty->driver.hangup)(tty); unlock_kernel(); } @@ -1243,6 +1258,7 @@ retry_open: if (!c) return -ENODEV; device = c->device(c); + filp->f_flags |= O_NONBLOCK; /* Don't let /dev/console block */ noctty = 1; } #ifdef CONFIG_UNIX98_PTYS diff --git a/drivers/char/videodev.c b/drivers/char/videodev.c index 2ba0bd030..e8ce8ddca 100644 --- a/drivers/char/videodev.c +++ b/drivers/char/videodev.c @@ -333,7 +333,7 @@ int videodev_init(void) { struct video_init *vfli = video_init_list; - printk(KERN_INFO "Linux video capture interface: v0.01 ALPHA\n"); + printk(KERN_INFO "Linux video capture interface: v1.00\n"); if(register_chrdev(VIDEO_MAJOR,"video_capture", &video_fops)) { printk("video_dev: unable to get major %d\n", VIDEO_MAJOR); diff --git a/drivers/net/ppp.c b/drivers/net/ppp.c index 8288e5f19..90bbffa8d 100644 --- a/drivers/net/ppp.c +++ b/drivers/net/ppp.c @@ -1291,6 +1291,9 @@ ppp_dev_close (struct device *dev) CHECK_PPP_MAGIC(ppp); + /* ppp_dev_close may be called with tbusy==1 so we must set it to 0 */ + dev->tbusy=0; + MOD_DEC_USE_COUNT; return 0; diff --git a/drivers/net/sdla_x25.c b/drivers/net/sdla_x25.c index 4f9ac70f6..4b92186d1 100644 --- a/drivers/net/sdla_x25.c +++ b/drivers/net/sdla_x25.c @@ -830,7 +830,7 @@ static struct net_device_stats* if_stats (struct device* dev) { x25_channel_t* chan = dev->priv; if(chan==NULL) - return chan; + return NULL; return &chan->ifstats; } diff --git a/drivers/scsi/scsicam.c b/drivers/scsi/scsicam.c index 3d434d2f6..6c0b6edd5 100644 --- a/drivers/scsi/scsicam.c +++ b/drivers/scsi/scsicam.c @@ -114,6 +114,8 @@ static int partsize(struct buffer_head *bh, unsigned long capacity, end_head = largest->end_head; end_sector = largest->end_sector & 0x3f; + if( end_head + 1 == 0 || end_sector == 0 ) return -1; + #ifdef DEBUG printk ("scsicam_bios_param : end at h = %d, c = %d, s = %d\n", end_head, end_cyl, end_sector); diff --git a/include/linux/linkage.h b/include/linux/linkage.h index cd5cdb349..5ac782d40 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h @@ -36,7 +36,7 @@ #ifdef __ASSEMBLY__ #define ALIGN __ALIGN -#define ALIGN_STRING __ALIGN_STRING +#define ALIGN_STR __ALIGN_STR #define ENTRY(name) \ .globl SYMBOL_NAME(name); \ diff --git a/init/main.c b/init/main.c index 0e234075a..9ef856fed 100644 --- a/init/main.c +++ b/init/main.c @@ -48,6 +48,10 @@ #include #endif +#ifdef CONFIG_ZORRO +#include +#endif + #ifdef CONFIG_MTRR # include #endif @@ -1174,9 +1178,6 @@ static void __init do_basic_setup(void) #ifdef CONFIG_SYSCTL sysctl_init(); #endif -#ifdef CONFIG_DIO - dio_init(); -#endif /* * Ok, at this point all CPU's should be initialized, so @@ -1197,6 +1198,12 @@ static void __init do_basic_setup(void) #ifdef CONFIG_ARCH_ACORN ecard_init(); #endif +#ifdef CONFIG_ZORRO + zorro_init(); +#endif +#ifdef CONFIG_DIO + dio_init(); +#endif /* Networking initialization needs a process context */ sock_init(); diff --git a/ipc/shm.c b/ipc/shm.c index 0ec61b1e3..48714cd16 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -101,7 +102,7 @@ found: return -ENOMEM; } - shp->shm_pages = (ulong *) kmalloc (numpages*sizeof(ulong),GFP_KERNEL); + shp->shm_pages = (ulong *) vmalloc (numpages*sizeof(ulong)); if (!shp->shm_pages) { shm_segs[id] = (struct shmid_ds *) IPC_UNUSED; wake_up (&shm_lock); @@ -204,7 +205,7 @@ static void killseg (int id) shm_swp--; } } - kfree(shp->shm_pages); + vfree(shp->shm_pages); shm_tot -= numpages; kfree(shp); return; diff --git a/mm/vmscan.c b/mm/vmscan.c index 884e67150..f3cdb9310 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -511,9 +511,10 @@ void __init kswapd_setup(void) int kswapd(void *unused) { struct wait_queue wait = { current, NULL }; + current->session = 1; current->pgrp = 1; - sprintf(current->comm, "kswapd"); + strcpy(current->comm, "kswapd"); sigfillset(¤t->blocked); /* diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 6c4e8ea8e..dc06be6b0 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -383,7 +383,7 @@ call_reserveresult(struct rpc_task *task) xprt_reserve(task); goto out; } else if (task->tk_status == -ETIMEDOUT) { - printk("RPC: task timed out\n"); + dprintk("RPC: task timed out\n"); task->tk_action = call_timeout; goto out; } else { diff --git a/scripts/lxdialog/dialog.h b/scripts/lxdialog/dialog.h index 3be5feb21..0e30d00d0 100644 --- a/scripts/lxdialog/dialog.h +++ b/scripts/lxdialog/dialog.h @@ -28,6 +28,24 @@ #include CURSES_LOC +/* + * Colors in ncurses 1.9.9e do not work properly since foreground and + * background colors are OR'd rather than separately masked. This version + * of dialog was hacked to work with ncurses 1.9.9e, making it incompatible + * with standard curses. The simplest fix (to make this work with standard + * curses) uses the wbkgdset() function, not used in the original hack. + * Turn it off if we're building with 1.9.9e, since it just confuses things. + */ +#if defined(NCURSES_VERSION) && defined(_NEED_WRAP) && !defined(GCC_PRINTFLIKE) +#define OLD_NCURSES 1 +#undef wbkgdset +#define wbkgdset(w,p) /*nothing*/ +#else +#define OLD_NCURSES 0 +#endif + +#define TR(params) _tracef params + #define ESC 27 #define TAB 9 #define MAX_LEN 2048 diff --git a/scripts/lxdialog/lxdialog.c b/scripts/lxdialog/lxdialog.c index 33f99fb09..6f4c1fd4e 100644 --- a/scripts/lxdialog/lxdialog.c +++ b/scripts/lxdialog/lxdialog.c @@ -63,6 +63,9 @@ main (int argc, const char * const * argv) (void) setlocale (LC_ALL, ""); #endif +#ifdef TRACE + trace(TRACE_CALLS|TRACE_UPDATE); +#endif if (argc < 2) { Usage (argv[0]); exit (-1); diff --git a/scripts/lxdialog/menubox.c b/scripts/lxdialog/menubox.c index 5d5a6b46f..a97620378 100644 --- a/scripts/lxdialog/menubox.c +++ b/scripts/lxdialog/menubox.c @@ -70,8 +70,12 @@ print_item (WINDOW * win, const char *item, int choice, int selected, int hotkey /* Clear 'residue' of last item */ wattrset (win, menubox_attr); wmove (win, choice, 0); +#if OLD_NCURSES for (i = 0; i < menu_width; i++) waddch (win, ' '); +#else + wclrtoeol(win); +#endif wattrset (win, selected ? item_selected_attr : item_attr); mvwaddstr (win, choice, item_x, menu_item); if (hotkey) { @@ -173,6 +177,7 @@ dialog_menu (const char *title, const char *prompt, int height, int width, for (i = 0; i < width - 2; i++) waddch (dialog, ACS_HLINE); wattrset (dialog, dialog_attr); + wbkgdset (dialog, dialog_attr & A_COLOR); waddch (dialog, ACS_RTEE); if (title != NULL) { diff --git a/scripts/lxdialog/textbox.c b/scripts/lxdialog/textbox.c index df50f2c54..5127e5f2c 100644 --- a/scripts/lxdialog/textbox.c +++ b/scripts/lxdialog/textbox.c @@ -90,6 +90,8 @@ dialog_textbox (const char *title, const char *file, int height, int width) /* Create window for text region, used for scrolling text */ text = subwin (dialog, height - 4, width - 2, y + 1, x + 1); + wattrset (text, dialog_attr); + wbkgdset (text, dialog_attr & A_COLOR); keypad (text, TRUE); @@ -101,6 +103,7 @@ dialog_textbox (const char *title, const char *file, int height, int width) for (i = 0; i < width - 2; i++) waddch (dialog, ACS_HLINE); wattrset (dialog, dialog_attr); + wbkgdset (dialog, dialog_attr & A_COLOR); waddch (dialog, ACS_RTEE); if (title != NULL) { @@ -459,8 +462,12 @@ print_line (WINDOW * win, int row, int width) getyx (win, y, x); /* Clear 'residue' of previous line */ +#if OLD_NCURSES for (i = 0; i < width - x; i++) waddch (win, ' '); +#else + wclrtoeol(win); +#endif } /* @@ -530,6 +537,7 @@ print_position (WINDOW * win, int height, int width) exit (-1); } wattrset (win, position_indicator_attr); + wbkgdset (win, position_indicator_attr & A_COLOR); percent = !file_size ? 100 : ((fpos - bytes_read + page - buf) * 100) / file_size; wmove (win, height - 3, width - 9); -- 2.11.4.GIT