- if (sizeof lock_info_str
- <= snprintf (lock_info_str, sizeof lock_info_str,
- boot ? "%s@%s.%"pMd":%"pMd : "%s@%s.%"pMd,
- user_name, host_name, pid, boot))
+ if (boot)
+ {
+ if (sizeof lock_info_str
+ <= snprintf (lock_info_str, sizeof lock_info_str,
+ "%s@%s.%"pMd":%"pMd,
+ user_name, host_name, pid, boot))
+ return ENAMETOOLONG;
+ }
+ else if (sizeof lock_info_str
+ <= snprintf (lock_info_str, sizeof lock_info_str,
+ "%s@%s.%"pMd,
+ user_name, host_name, pid))