]> sourceware.org Git - glibc.git/commitdiff
(_dl_important_hwcaps): Avoid using malloc early in the program.
authorUlrich Drepper <drepper@redhat.com>
Fri, 27 Jul 2001 03:48:11 +0000 (03:48 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 27 Jul 2001 03:48:11 +0000 (03:48 +0000)
elf/dl-support.c

index 09822218eb692a99d15668e86b842e252171bd4f..cd56ed411fd30970a90e4e00f2f1426b158cdf77 100644 (file)
@@ -187,16 +187,12 @@ internal_function
 _dl_important_hwcaps (const char *platform, size_t platform_len, size_t *sz,
                      size_t *max_capstrlen)
 {
-  struct r_strlenpair *result;
+  static struct r_strlenpair result;
+  static char buf[1];
 
-  /* XXX We don't try to find the capabilities in this case.  */
-  result = (struct r_strlenpair *) malloc (sizeof (*result));
-  if (result == NULL)
-    _dl_signal_error (ENOMEM, NULL, N_("cannot create capability list"));
-
-  result[0].str = (char *) result;     /* Does not really matter.  */
-  result[0].len = 0;
+  result.str = buf;    /* Does not really matter.  */
+  result.len = 0;
 
   *sz = 1;
-  return result;
+  return &result;
 }
This page took 0.04632 seconds and 5 git commands to generate.