| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{linux.intel,addtoit}.com) |
|---|
| 3 | | - * Licensed under the GPL |
|---|
| 4 | 4 | */ |
|---|
| 5 | 5 | |
|---|
| 6 | 6 | #include <stdlib.h> |
|---|
| .. | .. |
|---|
| 220 | 220 | unsigned long *stack_out) |
|---|
| 221 | 221 | { |
|---|
| 222 | 222 | struct winch_data data; |
|---|
| 223 | | - int fds[2], n, err; |
|---|
| 223 | + int fds[2], n, err, pid; |
|---|
| 224 | 224 | char c; |
|---|
| 225 | 225 | |
|---|
| 226 | 226 | err = os_pipe(fds, 1, 1); |
|---|
| .. | .. |
|---|
| 238 | 238 | * problem with /dev/net/tun, which if held open by this |
|---|
| 239 | 239 | * thread, prevents the TUN/TAP device from being reused. |
|---|
| 240 | 240 | */ |
|---|
| 241 | | - err = run_helper_thread(winch_thread, &data, CLONE_FILES, stack_out); |
|---|
| 242 | | - if (err < 0) { |
|---|
| 241 | + pid = run_helper_thread(winch_thread, &data, CLONE_FILES, stack_out); |
|---|
| 242 | + if (pid < 0) { |
|---|
| 243 | + err = pid; |
|---|
| 243 | 244 | printk(UM_KERN_ERR "fork of winch_thread failed - errno = %d\n", |
|---|
| 244 | 245 | -err); |
|---|
| 245 | 246 | goto out_close; |
|---|
| .. | .. |
|---|
| 263 | 264 | goto out_close; |
|---|
| 264 | 265 | } |
|---|
| 265 | 266 | |
|---|
| 266 | | - return err; |
|---|
| 267 | + return pid; |
|---|
| 267 | 268 | |
|---|
| 268 | 269 | out_close: |
|---|
| 269 | 270 | close(fds[1]); |
|---|