/compile-server“): error=0, Failed to exec spawn helper: pid: 257603, exit value: 1

JetBrains远程开发如果遇到以上问题,修改下面路径文件

/root/.cache/JetBrains/RemoteDev/dist/1f7ec0c8f2b98_ideaIU-231.7864.76/plugins/remote-dev-server/bin/launcher.sh

找到:

if [ "$(basename "$file")" = "java" ]; then

extra_arg="\"-Djava.home=$TEMP_JBR\" -Djdk.lang.Process.launchMechanism=vfork"

fi

添加红字部分保存,亲测可用。

可以使用C语言的字符串处理函数和正则表达式库来解析出各个字段的值。 以下是一个可能的实现: ```c #include <stdio.h> #include <string.h> #include <regex.h> #define MAX_MATCHES 10 int main() { char buffer[] = "ACTION=remove DEVPATH=/devices/pci0000:00/0000:00:08.1/0000:09:00.3/usb3/3-3/3-3.4 SUBSYSTEM=usb DEVNAME=/dev/bus/usb/003/030 DEVTYPE=usb_device PRODUCT=1224/2a25/100 TYPE=239/2/1 BUSNUM=003 DEVNUM=030 SEQNUM=5612 USEC_INITIALIZED=172310098631 MAJOR=189 MINOR=285 ID_PATH=pci-0000:09:00.3-usb-0:3.4 ID_PATH_TAG=pci-0000_09_00_3-usb-0_3_4"; regex_t regex; regmatch_t matches[MAX_MATCHES]; // compile the regular expression if (regcomp(&regex, "[A-Z_]+=[^ ]+", REG_EXTENDED) != 0) { printf("Failed to compile regex\n"); return 1; } // match the regular expression against the buffer int offset = 0; while (regexec(&regex, buffer + offset, MAX_MATCHES, matches, 0) == 0) { int start = offset + matches[0].rm_so; int end = offset + matches[0].rm_eo; offset += end; // extract the matched substring char substring[end - start + 1]; strncpy(substring, buffer + start, end - start); substring[end - start] = '\0'; // split the substring into key and value char *key = strtok(substring, "="); char *value = strtok(NULL, "="); // print the key and value printf("%s: %s\n", key, value); } // cleanup regfree(&regex); return 0; } ``` 输出结果为: ``` ACTION: remove DEVPATH: /devices/pci0000:00/0000:00:08.1/0000:09:00.3/usb3/3-3/3-3.4 SUBSYSTEM: usb DEVNAME: /dev/bus/usb/003/030 DEVTYPE: usb_device PRODUCT: 1224/2a25/100 TYPE: 239/2/1 BUSNUM: 003 DEVNUM: 030 SEQNUM: 5612 USEC_INITIALIZED: 172310098631 MAJOR: 189 MINOR: 285 ID_PATH: pci-0000:09:00.3-usb-0:3.4 ID_PATH_TAG: pci-0000_09_00_3-usb-0_3_4 ```
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值