- spin_lock_init(&newsighand->siglock);
- atomic_set(&newsighand->count, 1);
- memcpy(newsighand->action, oldsighand->action, sizeof(newsighand->action));
-
- /*
- * See if we need to allocate a new signal structure
- */
- newsig = NULL;
- if (atomic_read(&oldsig->count) > 1) {
- newsig = kmem_cache_alloc(signal_cachep, GFP_KERNEL);
- if (!newsig) {
- kmem_cache_free(sighand_cachep, newsighand);
- return -ENOMEM;
- }
- atomic_set(&newsig->count, 1);
- newsig->group_exit = 0;
- newsig->group_exit_code = 0;
- newsig->group_exit_task = NULL;
- newsig->group_stop_count = 0;
- newsig->curr_target = NULL;
- init_sigpending(&newsig->shared_pending);
- INIT_LIST_HEAD(&newsig->posix_timers);
-
- newsig->tty = oldsig->tty;
- newsig->pgrp = oldsig->pgrp;
- newsig->session = oldsig->session;
- newsig->leader = oldsig->leader;
- newsig->tty_old_pgrp = oldsig->tty_old_pgrp;
- }
-
- if (thread_group_empty(current))