"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libsysinfo-0.2.2/all/uname.c" between
linux_logo-5.11.tar.gz and linux_logo-6.0.tar.gz

About: Linux_Logo - an ANSI Color Penguin Logo that can be run at bootup. Also shows some system info.

uname.c  (linux_logo-5.11):uname.c  (linux_logo-6.0)
#include "sysinfo.h" #include "sysinfo.h"
#include <string.h> /* strncpy */ #include <string.h> /* strncpy */
#include <sys/utsname.h> /* uname */ #include <sys/utsname.h> /* uname */
#include "../include/generic.h"
int uname_get_os_info(struct os_info_type *os_info) { int uname_get_os_info(struct os_info_type *os_info) {
struct utsname buf; struct utsname buf;
uname(&buf); uname(&buf);
strncpy(os_info->os_name,buf.sysname,SYSINFO_OS_NAME_SIZE); strncpy_truncate(os_info->os_name,buf.sysname,
strncpy(os_info->os_version,buf.release,SYSINFO_OS_VERSION_SIZE); SYSINFO_OS_NAME_SIZE);
strncpy(os_info->os_revision,buf.version,SYSINFO_OS_REVISION_SIZE); strncpy_truncate(os_info->os_version,buf.release,
/* os_info->host_name=strdup(buf.nodename); */ SYSINFO_OS_VERSION_SIZE);
return 0; strncpy_truncate(os_info->os_revision,buf.version,
SYSINFO_OS_REVISION_SIZE);
/* os_info->host_name=strdup(buf.nodename); */
return 0;
} }
char *uname_get_host_name(char *hostname,char *domain) { char *uname_get_host_name(char *hostname,char *domain) {
struct utsname buf; struct utsname buf;
uname(&buf); uname(&buf);
strncpy(hostname,buf.nodename,SYSINFO_HOSTNAME_SIZE); strncpy_truncate(hostname,buf.nodename,SYSINFO_HOSTNAME_SIZE);
/* strncpy(domain,buf.domainname,64);*/ /* strncpy(domain,buf.domainname,64);*/
strncpy(domain,"Unknown",SYSINFO_DOMAIN_SIZE); /* Can't get there from here /* Can't get there from here */
*/ strncpy_truncate(domain,"Unknown",SYSINFO_DOMAIN_SIZE);
return hostname; return hostname;
} }
 End of changes. 7 change blocks. 
14 lines changed or deleted 19 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)