Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
df13d03f9c | ||
![]() |
615c10c75d | ||
![]() |
7cffe0797f |
2 changed files with 6 additions and 14 deletions
|
@ -1,7 +1,7 @@
|
|||
project(
|
||||
'seatd',
|
||||
'c',
|
||||
version: '0.6.3',
|
||||
version: '0.6.4',
|
||||
license: 'MIT',
|
||||
meson_version: '>=0.56.0',
|
||||
default_options: [
|
||||
|
|
|
@ -16,17 +16,12 @@ int main(int argc, char *argv[]) {
|
|||
const char *usage = "Usage: seatd-launch [options] [--] command\n"
|
||||
"\n"
|
||||
" -h Show this help message\n"
|
||||
" -s <path> Where to create the seatd socket\n"
|
||||
" -v Show the version number\n"
|
||||
"\n";
|
||||
|
||||
int c;
|
||||
char *sockpath = NULL;
|
||||
while ((c = getopt(argc, argv, "vhs:")) != -1) {
|
||||
while ((c = getopt(argc, argv, "vh")) != -1) {
|
||||
switch (c) {
|
||||
case 's':
|
||||
sockpath = optarg;
|
||||
break;
|
||||
case 'v':
|
||||
printf("seatd-launch version %s\n", SEATD_VERSION);
|
||||
return 0;
|
||||
|
@ -47,11 +42,8 @@ int main(int argc, char *argv[]) {
|
|||
}
|
||||
char **command = &argv[optind];
|
||||
|
||||
char sockbuf[256];
|
||||
if (sockpath == NULL) {
|
||||
sprintf(sockbuf, "/tmp/seatd.%d.sock", getpid());
|
||||
sockpath = sockbuf;
|
||||
}
|
||||
char sockpath[32];
|
||||
snprintf(sockpath, sizeof sockpath, "/tmp/seatd.%d.sock", getpid());
|
||||
|
||||
unlink(sockpath);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue