slave: emit user-notifications before dup:ing stdin/stdout/stderr

Since we need to restore the status flags anyway, there's nothing to
gain from emitting the user notifications after dup:ing the pts file
descriptor.

On the other hand, emitting user notifications *before* dup:ing means
we can still print error messages for e.g. write(3) errors.
This commit is contained in:
Daniel Eklöf 2020-08-01 09:00:18 +02:00
parent 7e93405b1a
commit c8e78674ed
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 54 additions and 49 deletions

View file

@ -2,12 +2,14 @@
#include <tllist.h>
enum user_notification_kind {
USER_NOTIFICATION_DEPRECATED,
USER_NOTIFICATION_WARNING,
USER_NOTIFICATION_ERROR,
};
struct user_notification {
enum {
USER_NOTIFICATION_DEPRECATED,
USER_NOTIFICATION_WARNING,
USER_NOTIFICATION_ERROR,
} kind;
enum user_notification_kind kind;
char *text;
};