* xen/arm: Fully initialise struct membanks_hdr fields * build: Set DATE to SOURCE_DATE_EPOCH if available (for reproducible builds) * x86: Add Support for Paging-Write Feature * x86/time: introduce command line option to select wallclock * x86/time: prefer CMOS over EFI_GET_TIME * xentrace: free CPU mask string before overwriting pointer * xl: properly dispose of vTPM struct instance * xl: properly dispose of libxl_dominfo struct instances * Various documentation fixes and adjustments * Various MISRA compliance improvements. OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=871
28 lines
937 B
Diff
28 lines
937 B
Diff
Index: xen-4.18.0-testing/tools/console/client/main.c
|
|
===================================================================
|
|
--- xen-4.18.0-testing.orig/tools/console/client/main.c
|
|
+++ xen-4.18.0-testing/tools/console/client/main.c
|
|
@@ -101,6 +101,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;
|
|
time_t start, now;
|
|
@@ -124,6 +125,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);
|
|
}
|