/* Replaces a string pointer with an strdup()ed new string,
* possibly freeing the old one. */
+ if (streq_ptr(*p, s))
+ return 0;
+
if (s) {
t = strdup(s);
if (!t)
free(*p);
*p = t;
- return 0;
+ return 1;
}
int sethostname_idempotent(const char *s) {