pv Stopped Working in the Background #55

Closed
opened 2022-10-31 19:45:44 +00:00 by CraigMiloRogers · 1 comment
CraigMiloRogers commented 2022-10-31 19:45:44 +00:00 (Migrated from github.com)

I have an application that starts a background pv process to generate a progress bar for a complex pipeline. This used to work as I expected in pv 1.6.6. It no longer works in pv 1.6.20. pv runs, but the progress bar is not displayed.

In the new routine pv_in_foreground(void), the code does not check for an error return from tcgetpgrp(STDERR_FILENO).

our_process_group = getpgrp(); 
tty_process_group = tcgetpgrp(STDERR_FILENO);                                                                                                             
if (our_process_group == tty_process_group)                                                                                                               
    return true; 

Changing the code to the following does what I want:

our_process_group = getpgrp();
tty_process_group = tcgetpgrp(STDERR_FILENO);   
if (tty_process_group == -1)
    return true;
if (our_process_group == tty_process_group)                                                                                                               
    return true; 

Alternatively, a command line flag to force pv_in_foreground() to always return true would be helpful.

I have an application that starts a background pv process to generate a progress bar for a complex pipeline. This used to work as I expected in pv 1.6.6. It no longer works in pv 1.6.20. pv runs, but the progress bar is not displayed. In the new routine pv_in_foreground(void), the code does not check for an error return from tcgetpgrp(STDERR_FILENO). ``` our_process_group = getpgrp(); tty_process_group = tcgetpgrp(STDERR_FILENO); if (our_process_group == tty_process_group) return true; ``` Changing the code to the following does what I want: ``` our_process_group = getpgrp(); tty_process_group = tcgetpgrp(STDERR_FILENO); if (tty_process_group == -1) return true; if (our_process_group == tty_process_group) return true; ``` Alternatively, a command line flag to force pv_in_foreground() to always return true would be helpful.
a-j-wood commented 2023-07-16 00:05:37 +00:00 (Migrated from github.com)

A fix for this has been suggested, and has been merged in. It will be in the next release.

A fix for this has been suggested, and has been merged in. It will be in the next release.
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: a-j-wood/pv#55
There is no content yet.