Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:tdz:branches:Base:System
plymouth
debug_stat.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File debug_stat.patch of Package plymouth
Index: plymouth-22.02.122+180.b1d5aa9/src/libply/ply-utils.c =================================================================== --- plymouth-22.02.122+180.b1d5aa9.orig/src/libply/ply-utils.c +++ plymouth-22.02.122+180.b1d5aa9/src/libply/ply-utils.c @@ -525,15 +525,29 @@ ply_file_exists (const char *file) return S_ISREG (file_info.st_mode); } +struct stat g_file_info; +char g_device[1024]; +int g_res; +int g_errno; +bool g_ischr; + bool ply_character_device_exists (const char *device) { struct stat file_info; - if (stat (device, &file_info) < 0) + strncpy(g_device, device, 1024); + + g_res = stat (device, &file_info); + g_errno = errno; + if (g_res < 0) return false; - return S_ISCHR (file_info.st_mode); + memcpy(&g_file_info, &file_info, sizeof(g_file_info)); + + g_ischr = S_ISCHR (file_info.st_mode); + + return g_ischr; } ply_module_handle_t * Index: plymouth-22.02.122+180.b1d5aa9/src/libply/ply-utils.h =================================================================== --- plymouth-22.02.122+180.b1d5aa9.orig/src/libply/ply-utils.h +++ plymouth-22.02.122+180.b1d5aa9/src/libply/ply-utils.h @@ -25,6 +25,7 @@ #include <stdint.h> #include <stdbool.h> #include <unistd.h> +#include <sys/stat.h> #include <sys/types.h> #ifndef MIN @@ -94,6 +95,13 @@ void ply_restore_errno (void); bool ply_directory_exists (const char *dir); bool ply_file_exists (const char *file); + +extern struct stat g_file_info; +extern char g_device[1024]; +extern int g_res; +extern int g_errno; +extern bool g_ischr; + bool ply_character_device_exists (const char *device); ply_module_handle_t *ply_open_module (const char *module_path); Index: plymouth-22.02.122+180.b1d5aa9/src/main.c =================================================================== --- plymouth-22.02.122+180.b1d5aa9.orig/src/main.c +++ plymouth-22.02.122+180.b1d5aa9/src/main.c @@ -22,6 +22,7 @@ #include "config.h" #include <sys/stat.h> +#include <sys/sysmacros.h> #include <sys/types.h> #include <math.h> #include <limits.h> @@ -31,6 +32,7 @@ #include <stdio.h> #include <sysexits.h> #include <sys/ioctl.h> +#include <time.h> #include <unistd.h> #include <wchar.h> #include <paths.h> @@ -2121,6 +2123,50 @@ initialize_environment (state_t *state) ply_trace ("source built on %s", __DATE__); + ply_trace ("g_device: %s", g_device); + ply_trace ("g_res: %d", g_res); + ply_trace ("g_errno: %d", g_errno); + ply_trace ("g_ischr: %d", g_ischr); + + ply_trace("ID of containing device: [%x,%x]\n", + major(g_file_info.st_dev), + minor(g_file_info.st_dev)); + + ply_trace("File type: "); + + switch (g_file_info.st_mode & S_IFMT) { + case S_IFBLK: ply_trace("block device"); break; + case S_IFCHR: ply_trace("character device"); break; + case S_IFDIR: ply_trace("directory"); break; + case S_IFIFO: ply_trace("FIFO/pipe"); break; + case S_IFLNK: ply_trace("symlink"); break; + case S_IFREG: ply_trace("regular file"); break; + case S_IFSOCK: ply_trace("socket"); break; + default: ply_trace("unknown?"); break; + } + + ply_trace("I-node number: %ju", (uintmax_t) g_file_info.st_ino); + + ply_trace("Mode: %jo (octal)", + (uintmax_t) g_file_info.st_mode); + + ply_trace("Link count: %ju", (uintmax_t) g_file_info.st_nlink); + ply_trace("Ownership: UID=%ju GID=%ju", + (uintmax_t) g_file_info.st_uid, (uintmax_t) g_file_info.st_gid); + + ply_trace("Preferred I/O block size: %jd bytes", + (intmax_t) g_file_info.st_blksize); + ply_trace("File size: %jd bytes", + (intmax_t) g_file_info.st_size); + ply_trace("Blocks allocated: %jd", + (intmax_t) g_file_info.st_blocks); + + ply_trace("Last status change: %s", ctime(&g_file_info.st_ctime)); + ply_trace("Last file access: %s", ctime(&g_file_info.st_atime)); + ply_trace("Last file modification: %s", ctime(&g_file_info.st_mtime)); + + + state->keystroke_triggers = ply_list_new (); state->entry_triggers = ply_list_new (); state->entry_buffer = ply_buffer_new ();
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor