Displaying 20 results from an estimated 24 matches for "link_name".
2014 Apr 15
1
[PATCH] Null terminate before printing the link name.
...-
usr/utils/readlink.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/usr/utils/readlink.c b/usr/utils/readlink.c
index 5ea4e41..75a0735 100644
- --- a/usr/utils/readlink.c
+++ b/usr/utils/readlink.c
@@ -15,6 +15,7 @@ int main(int argc, char *argv[])
{
char *name, *link_name = NULL;
size_t max_siz = 128;
+ size_t actual_siz = 0;
progname = *argv++;
@@ -28,8 +29,9 @@ int main(int argc, char *argv[])
exit(1);
}
- - if (readlink(name, link_name, max_siz) == -1)
+ if ((actual_siz = readlink(name, link_name, max_s...
2014 Apr 15
0
[klibc:master] readlink: Better buffer handling
...-----
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/usr/utils/readlink.c b/usr/utils/readlink.c
index 5ea4e41..8b620fd 100644
--- a/usr/utils/readlink.c
+++ b/usr/utils/readlink.c
@@ -13,8 +13,9 @@ static __noreturn usage(void)
int main(int argc, char *argv[])
{
- char *name, *link_name = NULL;
- size_t max_siz = 128;
+ const char *name;
+ char link_name[PATH_MAX];
+ int rv;
progname = *argv++;
@@ -22,15 +23,12 @@ int main(int argc, char *argv[])
if (!name)
usage();
- link_name = malloc(max_siz);
- if (!link_name) {
- perror("malloc");
+ rv = readlink(name,...
2014 Apr 15
0
[klibc:master] readlink: Handle multiple input arguments
...>
-char *progname;
+const char *progname;
static __noreturn usage(void)
{
- fprintf(stderr, "Usage: %s link\n", progname);
+ fprintf(stderr, "Usage: %s link...\n", progname);
exit(1);
}
@@ -16,19 +16,22 @@ int main(int argc, char *argv[])
const char *name;
char link_name[PATH_MAX];
int rv;
+ int i;
progname = *argv++;
- name = *argv++;
- if (!name)
+ if (argc < 2)
usage();
- rv = readlink(name, link_name, sizeof link_name - 1);
- if (rv < 0) {
- perror(name);
- exit(1);
+ while ((name = *argv++)) {
+ rv = readlink(name, link_name, sizeof link_...
2016 Jan 06
0
[klibc:master] readlink: Add -f option
...24 +7,45 @@ const char *progname;
static __noreturn usage(void)
{
- fprintf(stderr, "Usage: %s link...\n", progname);
+ fprintf(stderr, "Usage: %s [-f] link...\n", progname);
exit(1);
}
int main(int argc, char *argv[])
{
+ int c, f_flag = 0;
const char *name;
char link_name[PATH_MAX];
int rv;
int i;
- progname = *argv++;
+ progname = argv[0];
- if (argc < 2)
+ do {
+ c = getopt(argc, argv, "f");
+ if (c == EOF)
+ break;
+ switch (c) {
+ case 'f':
+ f_flag = 1;
+ break;
+
+ case '?':
+ fprintf(stderr, "%s: invalid...
2014 Sep 27
1
[PATCH 2/2] readlink: Add -f option
...24 +7,45 @@ const char *progname;
static __noreturn usage(void)
{
- fprintf(stderr, "Usage: %s link...\n", progname);
+ fprintf(stderr, "Usage: %s [-f] link...\n", progname);
exit(1);
}
int main(int argc, char *argv[])
{
+ int c, f_flag = 0;
const char *name;
char link_name[PATH_MAX];
int rv;
int i;
- progname = *argv++;
+ progname = argv[0];
- if (argc < 2)
+ do {
+ c = getopt(argc, argv, "f");
+ if (c == EOF)
+ break;
+ switch (c) {
+ case 'f':
+ f_flag = 1;
+ break;
+
+ case '?':
+ fprintf(stderr, "%s: invalid...
2011 Jul 07
5
[PATCH 0/5] checkpatch cleanups
It seems checkpatch errors krept in, this is a first go.
Next run will go into usr/kinit directory.
No code changes, just codingstyle fixes (verified with size(3)).
maximilian attems (5):
[klibc] sleep: have argument on next line
[klibc] readklink: remove unneeded braces
[klibc] mount: whitespace policy
[klibc] ls: fix various checkpatch complaints
[klibc] tests: checkpatch fixlets
2009 May 29
1
[PATCH v2] klibc-utils: add simple ls
...t; max_min)
+ max_min = bytes;
+
+ max_size = max_maj + max_min + 1;
+ }
+ else {
+ if ((bytes = snprintf(NULL, 0, "%ju", (uintmax_t) st->st_size)) > max_size)
+ max_size = bytes;
+ }
+ return;
+}
+
+static void do_stat(const struct stat *st, const char *path)
+{
+ char *fmt, *link_name;
+ int rc;
+
+ switch (st->st_mode & S_IFMT) {
+ case S_IFBLK: putchar('b'); break;
+ case S_IFCHR: putchar('c'); break;
+ case S_IFDIR: putchar('d'); break;
+ case S_IFIFO: putchar('p'); break;
+ case S_IFLNK: putchar('l'); break;
+ case S_...
2016 Jan 06
3
[PATCH klibc 0/3] Changes to support initramfs-tools 0.117
initramfs-tools version 0.117 requires 'readlink -f' and
'mount -o defaults' to work.
The first two patches were previously submitted but not applied.
Ben.
Ben Hutchings (3):
Implement realpath()
readlink: Add -f option
mount: Implement -o defaults
usr/include/stdlib.h | 2 ++
usr/klibc/Kbuild | 2 +-
usr/klibc/realpath.c | 49
2009 May 28
1
[PATCH] klibc-utils: add minils
...max_size = max_maj + max_min + 1;
+ }
+ else {
+ if ((bytes = snprintf(NULL, 0, "%ju", (uintmax_t) st->st_size)) > max_size)
+ max_size = bytes;
+ }
+ return;
+}
+
+static void do_stat(const struct stat *st, const char *path)
+{
+ size_t max_siz = 128;
+ size_t sz;
+ char *fmt, *link_name;
+
+ switch (st->st_mode & S_IFMT) {
+ case S_IFBLK: printf("b"); break;
+ case S_IFCHR: printf("c"); break;
+ case S_IFDIR: printf("d"); break;
+ case S_IFIFO: printf("p"); break;
+ case S_IFLNK: printf("l"); break;
+ case S_IFSOC...
2023 Jan 13
0
[klibc:master] ls: Handle relative directory names correctly
...77bc0f..50af4349 100644
--- a/usr/utils/ls.c
+++ b/usr/utils/ls.c
@@ -50,7 +50,7 @@ static void do_preformat(const struct stat *st)
return;
}
-static void do_stat(const struct stat *st, const char *path)
+static void do_stat(const struct stat *st, int dir_fd, const char *path)
{
char *fmt, *link_name;
int rc;
@@ -138,7 +138,7 @@ static void do_stat(const struct stat *st, const char *path)
perror("malloc");
exit(1);
}
- rc = readlink(path, link_name, max_linksiz);
+ rc = readlinkat(dir_fd, path, link_name, max_linksiz);
if (rc == -1) {
free(link_name);
perror(...
2014 Apr 15
0
[klibc:master] readlink: Reduce size by calling _fwrite() instead of puts()
...eadlink.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/usr/utils/readlink.c b/usr/utils/readlink.c
index bf9501b..4e3cfcb 100644
--- a/usr/utils/readlink.c
+++ b/usr/utils/readlink.c
@@ -29,8 +29,8 @@ int main(int argc, char *argv[])
perror(name);
exit(1);
}
- link_name[rv] = '\0';
- puts(link_name);
+ link_name[rv] = '\n';
+ _fwrite(link_name, rv+1, stdout);
}
return 0;
2007 Aug 24
2
[git patch] klibc bzero, mount fixes + random stuff
hello hpa,
please pull for the latest
git pull git://brane.itp.tuwien.ac.at/~mattems/klibc.git maks
with the following shortlog:
maximilian attems (9):
mount: add nodev, noexec and nosuid options
mount: add -n option
cpio: small cleanups
readlink: s/link/link_name/
kinit, mknod: s/(major|minor)/\1_num/
klibc: strcspn, strpbrk, strspn include string.h
resume, kill: axe unused envp usage
devname.c: include kinit.h
add bzero()
and diffstat
usr/include/string.h | 1
usr/kinit/devname.c | 2 +
usr/kinit/do_mounts...
2006 Jul 21
1
RJS Failing
...'link'', :object => new_link
page.visual_effect :highlight, "link-#{new_link.id}"
page.replace_html ''new_link_error'', ''''
page[''link_url''].value = ''http://''
page[''link_name''].value = ''''
page[''link_description''].value = ''''
else # not saved, present error messages
page.replace_html ''new_link_error'', error_messages_for(new_link)
page.visual_effect :appear, '...
2006 Jun 02
3
Custom Pagination Links
...=> "prevlink"}) if
@my_pages.current.previous %>
<% for page in @my_pages -%>
<%= link_to_unless(params[:page].to_i == page.number, page.number,
{:params => params.merge(''page'' => page)},
{:class => "pagelink"}) {|link_name|
"<span class=\"currentpage\">#{link_name}</span>"} %>
<% end %>
<%= link_to(''Next >'', {:params => params.merge(''page'' =>
@my_pages.current.next)}, {:class => "nextlink"}) if
@my...
2006 May 23
3
image_tag problem
Hiall,
I want to make an image_tag from within a controller in order to be
able to present a link (with a status image) in a view. Here is my
controller method (in file webca_controller.rb, hence WebcaController)
def untouched_status_image_tag
image_tag("open", { :alt => "Offen", :title => "Offen", :size =>
"12x12", :class =>
2006 Jul 16
6
How to access element attributes using RJS?
For example, in the following block:
page.select(''.foo'').each do |element|
...
end
How would I access, just for example, the id attribute of each element in
the collection?
I''ve randomly tried element.id and element.attributes[''id''], but neither of
those has worked. I''ve also been unsuccessful in finding any documentation
on this, but it
2006 Jul 18
6
RJS - Insert at top of table?
...he create.rjs file:
if @saved
page.insert_html :top, ''links-list'', :partial => ''link'', :object =>
@link
page.visual_effect :highlight, "link-#{@link.id}"
page[''link_url''].value = ''http://''
page[''link_name''].value = ''''
page[''link_description''].value = ''''
else
# not saved, so send back the error messages and new form
end
...My question is, how can I insert the new link partial (a table row)
below the row containing the <th>'...
2019 Jan 18
0
[klibc:master] remove unused variables
...bytes;
- char *p;
va_start(ap, format);
rv = vasprintf(bufp, format, ap);
diff --git a/usr/utils/readlink.c b/usr/utils/readlink.c
index ffb0b1f..1f16c02 100644
--- a/usr/utils/readlink.c
+++ b/usr/utils/readlink.c
@@ -17,7 +17,6 @@ int main(int argc, char *argv[])
const char *name;
char link_name[PATH_MAX];
int rv;
- int i;
progname = argv[0];
2006 Jul 11
0
Ajax.InPlaceEditor + onComplete
..._place_editor_field" and pass an
onComplete to it, but it seems that I can''t pass that :success or
:onComplete because they become attributes of the span on to of the
Javascript:
Here is my desired Javascript outcome:
new Ajax.InPlaceEditor(''div_name'', ''link_name'',
{onComplete:function(){new Ajax.Updater(''other_div'',
''other_link'', {asynchronous:true, evalScripts:true})}})
Currently, I am doing it manually, but it would be nice to use the
helper.
Thanks,
Roland
--
Posted via http://ww...
2018 Feb 26
3
[PATCH 1/4] include sys/types.h in more places
Include sys/types.h to avoid compilation warnings:
In file included from $LINUX/usr/include/linux/byteorder/little_endian.h:12:0,
from $LINUX/usr/include/asm/byteorder.h:5,
from $KLIBC/usr/klibc/../include/klibc/endian.h:11,
from $KLIBC/usr/klibc/../include/endian.h:8,
from $KLIBC/usr/klibc/pread.c:7: