use the new feature of pic_get_args (port specifier)
This commit is contained in:
parent
d9911cabc8
commit
4a7a32829d
|
@ -330,15 +330,9 @@ pic_port_eof_object(pic_state *pic)
|
||||||
static pic_value
|
static pic_value
|
||||||
pic_port_close_port(pic_state *pic)
|
pic_port_close_port(pic_state *pic)
|
||||||
{
|
{
|
||||||
pic_value v;
|
|
||||||
struct pic_port *port;
|
struct pic_port *port;
|
||||||
|
|
||||||
pic_get_args(pic, "o", &v);
|
pic_get_args(pic, "p", &port);
|
||||||
|
|
||||||
if (! pic_port_p(v)) {
|
|
||||||
pic_error(pic, "close-port: expected port");
|
|
||||||
}
|
|
||||||
port = pic_port_ptr(v);
|
|
||||||
|
|
||||||
if (fclose(port->file) == EOF) {
|
if (fclose(port->file) == EOF) {
|
||||||
pic_error(pic, "close-port: failure");
|
pic_error(pic, "close-port: failure");
|
||||||
|
|
Loading…
Reference in New Issue