<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 18, 2024 at 9:18 AM Peter Dufault <<a href="mailto:dufault@hda.com">dufault@hda.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I just rebased to "6-freebsd-12". This change:<br>
<br>
###<br>
commit 62e0ca8283603573d42a0f15da044cd406a2f00a<br>
Author: Kinsey Moore <<a href="mailto:kinsey.moore@oarcorp.com" target="_blank">kinsey.moore@oarcorp.com</a>><br>
Date: Tue Jan 23 13:25:45 2024 -0600<br>
<br>
rtemsbsd/rtems: Check function return values<br>
###<br>
[dufault@gen6 rtems-libbsd]$ git diff 6514d561587fd1527fe6a26cb43e6b5742c8c779 rtemsbsd/rtems/rtems-kernel-init.c<br>
diff --git a/rtemsbsd/rtems/rtems-kernel-init.c b/rtemsbsd/rtems/rtems-kernel-init.c<br>
index 90a9c80..8ac2f59 100644<br>
--- a/rtemsbsd/rtems/rtems-kernel-init.c<br>
+++ b/rtemsbsd/rtems/rtems-kernel-init.c<br>
@@ -223,7 +223,9 @@ rtems_bsd_initialize(void)<br>
return RTEMS_UNSATISFIED;<br>
}<br>
<br>
- mkdir("/etc", S_IRWXU | S_IRWXG | S_IRWXO);<br>
+ if (mkdir("/etc", S_IRWXU | S_IRWXG | S_IRWXO) != 0) {<br>
+ return RTEMS_UNSATISFIED;<br>
+ }<br>
<br>
sc = rtems_timer_initiate_server(rtems_bsd_get_task_priority(name),<br>
rtems_bsd_get_task_stack_size(name), RTEMS_DEFAULT_ATTRIBUTES);<br>
###<br>
<br>
causes a crash at startup in "uma_zalloc()" (in at least the "telnetd01" test).<br>
I printed out the error, the directory already exists:<br>
<br>
mkdir("/etc",...): File exists<br>
<br>
For now I'm just checking for EEXIST and ignoring the error.<br>
Does anyone care to object now and say I should investigate further to fix the caller before I submit a patch?<br></blockquote><div><br></div><div>A patch for EEXIST here should be fine. It would be nice if the caller were more resilient.</div><div><br></div><div>Kinsey <br></div></div></div>