+#ifdef MPOP
+static int
+sm_perror (char *fmt, ...)
+{
+ /* Fill in sm_reply with a suitable error string based on errno.
+ * This isn't particularly MPOP specific, it just happens that that's
+ * the only code that uses it currently.
+ */
+ char *bp, *s;
+ int len, eno = errno;
+
+ va_list ap;
+ va_start(ap,fmt);
+ vsnprintf (sm_reply.text, sizeof(sm_reply.text), fmt, ap);
+ va_end(ap);
+
+ bp = sm_reply.text;
+ len = strlen(bp);
+ bp += len;
+ if ((s = strerror(eno)))
+ snprintf(bp, sizeof(sm_reply.text) - len, "%s", s);
+ else
+ snprintf(bp, sizeof(sm_reply.text) - len, "unknown error %d", eno);
+
+ sm_reply.length = strlen (sm_reply.text);
+ sm_reply.code = NOTOK;
+
+ return RP_BHST;
+}
+#endif