mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-01 23:05:39 +00:00
tty: Cleanup tty mutex preparation
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
10
cr-restore.c
10
cr-restore.c
@@ -91,6 +91,10 @@ static int prepare_shared(void)
|
|||||||
if (prepare_shared_fdinfo())
|
if (prepare_shared_fdinfo())
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
if (prepare_shared_tty())
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
|
||||||
if (collect_reg_files())
|
if (collect_reg_files())
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@@ -145,15 +149,11 @@ static int prepare_shared(void)
|
|||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
mark_pipe_master();
|
mark_pipe_master();
|
||||||
|
|
||||||
ret = tty_setup_orphan_slavery(&opts);
|
ret = tty_setup_orphan_slavery(&opts);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
|
|
||||||
ret = tty_prepare_shared();
|
|
||||||
if (ret)
|
|
||||||
goto err;
|
|
||||||
|
|
||||||
ret = resolve_unix_peers();
|
ret = resolve_unix_peers();
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err;
|
goto err;
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
extern int dump_tty(struct fd_parms *p, int lfd, const struct cr_fdset *set);
|
extern int dump_tty(struct fd_parms *p, int lfd, const struct cr_fdset *set);
|
||||||
extern int collect_tty(void);
|
extern int collect_tty(void);
|
||||||
extern int tty_is_master(struct fdinfo_list_entry *le);
|
extern int tty_is_master(struct fdinfo_list_entry *le);
|
||||||
extern int tty_prepare_shared(void);
|
extern int prepare_shared_tty(void);
|
||||||
extern int tty_setup_orphan_slavery(const struct cr_options *opts);
|
extern int tty_setup_orphan_slavery(const struct cr_options *opts);
|
||||||
|
|
||||||
#endif /* CR_TTY_H__ */
|
#endif /* CR_TTY_H__ */
|
||||||
|
2
tty.c
2
tty.c
@@ -104,7 +104,7 @@ static DECLARE_BITMAP(tty_bitmap, (MAX_TTYS << 1));
|
|||||||
*/
|
*/
|
||||||
static mutex_t *tty_mutex;
|
static mutex_t *tty_mutex;
|
||||||
|
|
||||||
int tty_prepare_shared(void)
|
int prepare_shared_tty(void)
|
||||||
{
|
{
|
||||||
tty_mutex = shmalloc(sizeof(*tty_mutex));
|
tty_mutex = shmalloc(sizeof(*tty_mutex));
|
||||||
if (!tty_mutex) {
|
if (!tty_mutex) {
|
||||||
|
Reference in New Issue
Block a user