tool api fs: Correctly encode errno for read/write open failures
Subsystems (2)
Sasha Levin
maintainerPATCH 1/2 tool api fs: Correctly encode errno for read/write open failures
From: Ian Rogers <[email protected]>
[ Upstream commit 05be17eed774aaf56f6b1e12714325ca3a266c04 ]
Switch from returning -1 to -errno so that callers can determine types of failure.
--- tools/lib/api/fs/fs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tools/lib/api/fs/fs.c +3 -3
@@ -323,7 +323,7 @@ int filename__read_int(const char *filename, int *value)int fd =open (filename,O_RDONLY ), err =-1 ;if (fd <0 ) -return -1 ; +return -errno;if (read (fd, line,sizeof (line)) >0 ) { *value =atoi (line);
@@ -341,7 +341,7 @@ static int filename__read_ull_base(const char *filename,int fd =open (filename,O_RDONLY ), err =-1 ;if (fd <0 ) -return -1 ; +return -errno;if (read (fd, line,sizeof (line)) >0 ) { *value =strtoull (line,NULL , base);
@@ -428,7 +428,7 @@ int filename__write_int(const char *filename, int value)char buf[64 ];if (fd <0 ) -return err; +return -errno;sprintf (buf,"%d" , value);if (write (fd, buf,sizeof (buf)) ==sizeof (buf))
Signature · 1 line
2.39.5
Sasha Levin
maintainerPATCH 2/2 Input: allocate keycode for phone linking
From: Illia Ostapyshyn <[email protected]>
[ Upstream commit 1bebc7869c99d466f819dd2cffaef0edf7d7a035 ]
The F11 key on the new Lenovo Thinkpad T14 Gen 5, T16 Gen 3, and P14s Gen 5 laptops includes a symbol showing a smartphone and a laptop chained together. According to the user manual, it starts the Microsoft Phone Link software used to connect to Android/iOS devices and relay messages/calls or sync data.
As there are no suitable keycodes for this action, introduce a new one.
--- include/uapi/linux/input-event-codes.h | 1 + 1 file changed, 1 insertion(+)
include/uapi/linux/input-event-codes.h +1 -0
@@ -519,6 +519,7 @@#define KEY_NOTIFICATION_CENTER 0x1bc/* Show/hide the notification center */ #define KEY_PICKUP_PHONE 0x1bd/* Answer incoming call */ #define KEY_HANGUP_PHONE 0x1be/* Decline incoming call */ +#define KEY_LINK_PHONE 0x1bf/* AL Phone Syncing */ #define KEY_DEL_EOL 0x1c0#define KEY_DEL_EOS 0x1c1
Signature · 1 line
2.39.5