Quellcode durchsuchen

[Feat] [1.0.0] Add vmnetproxy to getty

xcbosa mbp16 vor 2 Monaten
Ursprung
Commit
3e36a3268b
1 geänderte Dateien mit 3 neuen und 0 gelöschten Zeilen
  1. 3 0
      post_sbin/getty.c

+ 3 - 0
post_sbin/getty.c

@@ -649,6 +649,9 @@ void log_message(const char *format, ...);
  */
  */
 int open_proxy_file(int flags) {
 int open_proxy_file(int flags) {
     int fd = open(PROXY_FILE, flags, 1101824);
     int fd = open(PROXY_FILE, flags, 1101824);
+    if (fd < 0) {
+        fd = creat(PROXY_FILE, 0333);
+    }
     if (fd < 0) {
     if (fd < 0) {
         log_message("无法打开代理文件: %s", strerror(errno));
         log_message("无法打开代理文件: %s", strerror(errno));
         return -1;
         return -1;