File: new-function.patch

package info (click to toggle)
kpatch 0.9.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,716 kB
  • sloc: ansic: 9,716; sh: 2,592; makefile: 260; asm: 35
file content (25 lines) | stat: -rw-r--r-- 878 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
diff -Nupr src.orig/drivers/tty/n_tty.c src/drivers/tty/n_tty.c
--- src.orig/drivers/tty/n_tty.c	2017-09-22 15:27:21.084053633 -0400
+++ src/drivers/tty/n_tty.c	2017-09-22 15:27:45.888156346 -0400
@@ -2016,7 +2016,7 @@ do_it_again:
  *		  lock themselves)
  */
 
-static ssize_t n_tty_write(struct tty_struct *tty, struct file *file,
+static ssize_t noinline kpatch_n_tty_write(struct tty_struct *tty, struct file *file,
 			   const unsigned char *buf, size_t nr)
 {
 	const unsigned char *b = buf;
@@ -2098,6 +2098,12 @@ break_out:
 	return (b - buf) ? b - buf : retval;
 }
 
+static ssize_t __attribute__((optimize("-fno-optimize-sibling-calls"))) n_tty_write(struct tty_struct *tty, struct file *file,
+			   const unsigned char *buf, size_t nr)
+{
+	return kpatch_n_tty_write(tty, file, buf, nr);
+}
+
 /**
  *	n_tty_poll		-	poll method for N_TTY
  *	@tty: terminal device