}
/*
- * Open directory @path in read-onl mode. If the path is NULL then duplicate FD
+ * Open directory @path in read-only mode. If the path is NULL then duplicate FD
* to the directory addressed by @pc.
*/
DIR *ul_path_opendir(struct path_cxt *pc, const char *path)
/*
- * Open directory @path in read-onl mode. If the path is NULL then duplicate FD
+ * Open directory @path in read-only mode. If the path is NULL then duplicate FD
* to the directory addressed by @pc.
*/
DIR *ul_path_vopendirf(struct path_cxt *pc, const char *path, va_list ap)
}
/*
- * Open directory @path in read-onl mode. If the path is NULL then duplicate FD
+ * Open directory @path in read-only mode. If the path is NULL then duplicate FD
* to the directory addressed by @pc.
*/
DIR *ul_path_opendirf(struct path_cxt *pc, const char *path, ...)
if (rc < 0)
return rc;
- /* Remove tailing newline (usual in sysfs) */
+ /* Remove trailing newline (usual in sysfs) */
if (rc > 0 && *(buf + rc - 1) == '\n')
--rc;
if (rc == 0)
buf[0] = '\0';
else if (rc > 0) {
- /* Remove tailing newline (usual in sysfs) */
+ /* Remove trailing newline (usual in sysfs) */
if (*(buf + rc - 1) == '\n')
buf[--rc] = '\0';
else
return !p ? -errno : ul_path_count_dirents(pc, p);
}
-/* first call (when @sub is NULL) opens the directory, last call closes the diretory */
+/* first call (when @sub is NULL) opens the directory, last call closes the directory */
int ul_path_next_dirent(struct path_cxt *pc, DIR **sub, const char *dirname, struct dirent **d)
{
if (!pc || !sub || !d)