f18f683ba6
xen-4.7.0-testing-src.tar.bz2 - Dropped: xen-4.6.1-testing-src.tar.bz2 55f7f9d2-libxl-slightly-refine-pci-assignable-add-remove-handling.patch 5628fc67-libxl-No-emulated-disk-driver-for-xvdX-disk.patch 5644b756-x86-HVM-don-t-inject-DB-with-error-code.patch 5649bcbe-libxl-relax-readonly-check-introduced-by-XSA-142-fix.patch hotplug-Linux-block-performance-fix.patch set-mtu-from-bridge-for-tap-interface.patch xendomains-libvirtd-conflict.patch xsa154.patch xsa155-xen-0001-xen-Add-RING_COPY_REQUEST.patch xsa155-xen-0002-blktap2-Use-RING_COPY_REQUEST.patch xsa155-xen-0003-libvchan-Read-prod-cons-only-once.patch xsa170.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=414
28 lines
931 B
Diff
28 lines
931 B
Diff
Index: xen-4.7.0-testing/tools/console/client/main.c
|
|
===================================================================
|
|
--- xen-4.7.0-testing.orig/tools/console/client/main.c
|
|
+++ xen-4.7.0-testing/tools/console/client/main.c
|
|
@@ -100,6 +100,7 @@ static int get_pty_fd(struct xs_handle *
|
|
* Assumes there is already a watch set in the store for this path. */
|
|
{
|
|
struct timeval tv;
|
|
+ struct flock lock;
|
|
fd_set watch_fdset;
|
|
int xs_fd = xs_fileno(xs), pty_fd = -1;
|
|
int start, now;
|
|
@@ -123,6 +124,14 @@ static int get_pty_fd(struct xs_handle *
|
|
pty_fd = open(pty_path, O_RDWR | O_NOCTTY);
|
|
if (pty_fd == -1)
|
|
warn("Could not open tty `%s'", pty_path);
|
|
+ else {
|
|
+ memset(&lock, 0, sizeof(lock));
|
|
+ lock.l_type = F_WRLCK;
|
|
+ lock.l_whence = SEEK_SET;
|
|
+ if (fcntl(pty_fd, F_SETLK, &lock) != 0)
|
|
+ err(errno, "Could not lock tty '%s'",
|
|
+ pty_path);
|
|
+ }
|
|
}
|
|
free(pty_path);
|
|
}
|