Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MFH: r409224 PR: 206846 Submitted by: Tobias Kortkamp <t@tobik.me> Approved by: ports-secteam (blanket)
- Loading branch information
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Description: Use correct namelen when connecting to i3 socket | ||
# Pull Request: https://github.com/DaveDavenport/rofi/pull/330 | ||
--- source/i3-support.c.orig 2015-12-27 18:45:50 UTC | ||
+++ source/i3-support.c | ||
@@ -50,7 +50,7 @@ char *i3_socket_path = NULL; | ||
void i3_support_focus_window ( Window id ) | ||
{ | ||
i3_ipc_header_t head; | ||
- int s, len; | ||
+ int s; | ||
ssize_t t; | ||
struct sockaddr_un remote; | ||
size_t upm = sizeof ( remote.sun_path ); | ||
@@ -68,9 +68,8 @@ void i3_support_focus_window ( Window id | ||
|
||
remote.sun_family = AF_UNIX; | ||
g_strlcpy ( remote.sun_path, i3_socket_path, upm ); | ||
- len = strlen ( remote.sun_path ) + sizeof ( remote.sun_family ); | ||
|
||
- if ( connect ( s, ( struct sockaddr * ) &remote, len ) == -1 ) { | ||
+ if ( connect ( s, ( struct sockaddr * ) &remote, sizeof ( struct sockaddr_un ) ) == -1 ) { | ||
fprintf ( stderr, "Failed to connect to I3 (%s): %s\n", i3_socket_path, strerror ( errno ) ); | ||
close ( s ); | ||
return; |