Browse Source

Don't call null ctors/dtors.
-Erik

Eric Andersen 23 năm trước cách đây
mục cha
commit
608b520c75
1 tập tin đã thay đổi với 5 bổ sung2 xóa
  1. 5 2
      libc/misc/internals/__uClibc_main.c

+ 5 - 2
libc/misc/internals/__uClibc_main.c

@@ -72,9 +72,12 @@ __uClibc_main(int argc, char **argv, char **envp)
 	  _stdio_init();
 
 	/* Arrange for dtors to run at exit.  */
-	atexit (&_fini);
+	if (_fini && atexit) {
+	    atexit (&_fini);
+	}
 	/* Run all ctors now.  */
-	_init();
+	if (_init)
+	    _init();
 
 	/*
 	 * Note: It is possible that any initialization done above could